-
Notifications
You must be signed in to change notification settings - Fork 1.3k
refactor: update AutoTriggerStrategy.getPrompts API to accept AutocompleteInput #3189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4e794e1
refactor: update AutoTriggerStrategy.getPrompts API to accept Autocom…
markijbema 6e1993c
refactor: use AutocompleteInput data instead of context in getPrompts
markijbema 053ac17
refactor: remove unused context parameter from AutoTriggerStrategy.ge…
markijbema a795e8c
refactor: use contextToAutocompleteInput helper to eliminate code dup…
markijbema 601de24
remove now unused function
markijbema 58b539d
less duplication in test
markijbema 7aecf00
remove unused vars
markijbema 88eba22
remove comments
markijbema 4cc58cf
cleanup test
markijbema 74a7bec
cleanup test
markijbema 930df4c
remove unused parameter
markijbema ec535e7
remove unused method
markijbema 2122e35
remove unused method
markijbema e1a89c2
remove unused import
markijbema File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,56 +38,6 @@ export function isCommentLine(line: string, languageId: string): boolean { | |
| return false | ||
| } | ||
|
|
||
| export function extractComment(document: TextDocument, currentLine: number): string { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unrelated, but when i removed use of another import of autotrigger strategy i noticed this was unused as well |
||
| let comment = "" | ||
|
|
||
| // Get the comment (could be multi-line) | ||
| let commentStartLine = currentLine | ||
| let commentEndLine = currentLine | ||
|
|
||
| // Check if current line is a comment | ||
| const currentLineText = document.lineAt(currentLine).text | ||
| if (isCommentLine(currentLineText.trim(), document.languageId)) { | ||
| comment = currentLineText.trim() | ||
|
|
||
| // Check for multi-line comments above | ||
| let line = currentLine - 1 | ||
| while (line >= 0) { | ||
| const lineText = document.lineAt(line).text.trim() | ||
| if (isCommentLine(lineText, document.languageId)) { | ||
| comment = lineText + "\n" + comment | ||
| commentStartLine = line | ||
| line-- | ||
| } else { | ||
| break | ||
| } | ||
| } | ||
|
|
||
| // Check for multi-line comments below | ||
| line = currentLine + 1 | ||
| while (line < document.lineCount) { | ||
| const lineText = document.lineAt(line).text.trim() | ||
| if (isCommentLine(lineText, document.languageId)) { | ||
| comment = comment + "\n" + lineText | ||
| commentEndLine = line | ||
| line++ | ||
| } else { | ||
| break | ||
| } | ||
| } | ||
| } else if (currentLine > 0) { | ||
| // Check previous line for comment | ||
| const prevLineText = document.lineAt(currentLine - 1).text | ||
| if (isCommentLine(prevLineText.trim(), document.languageId)) { | ||
| comment = prevLineText.trim() | ||
| commentStartLine = currentLine - 1 | ||
| commentEndLine = currentLine - 1 | ||
| } | ||
| } | ||
|
|
||
| return comment | ||
| } | ||
|
|
||
| /** | ||
| * Cleans comment text by removing comment syntax | ||
| */ | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it removes these ifs, but i do not think they were ever necessary tbh