-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed as not planned
Labels
DiscussionIssues which may not have code impactIssues which may not have code impactQuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
Hi, I'm a language server developer. I am very curious about how to implement the Import-on-Paste function you mentioned above?
Here is my idea, is it feasible? (sorry but reading ts source code is a bit difficult for me)
- Before pasting the text in the clipboard into the file, maintain a string of the pasted text in the memory
- Compile the new code in this memory
- If there is no syntax error, if an undefined symbol error is encountered in the line where the paste is located, try to do automatic completion at the location of the symbol
- If there is an automatic completion item that completely matches the text of the symbol, complete the import statement corresponding to this item (the same as the behavior of the user manually selecting this completion item)
- Repeat 2 to 5 until there is no such error, or there is no completely matching text
- Overwrite the text string in the memory into the file to be pasted
imbant and navya9singh
Metadata
Metadata
Assignees
Labels
DiscussionIssues which may not have code impactIssues which may not have code impactQuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code