-
Notifications
You must be signed in to change notification settings - Fork 45
Debug: log to show difference in vscode.executeCompletionItemProvider in vscode vs Positron
#777
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,13 +25,15 @@ export async function vdocCompletions( | |
| parentUri: Uri | ||
| ) { | ||
| const completions = await withVirtualDocUri(vdoc, parentUri, "completion", async (uri: Uri) => { | ||
| console.log('vdocCompletions vdoc uri, adjustedPosition, trigger', uri, adjustedPosition(language, position), trigger) | ||
|
Collaborator
Author
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. This is right before the place where the the visual editor calls a vscode command to gets its completions for Python and R. Let's log out all the arguments to the command. I looked at this log during a test where I ran an extension host in both vscode and Positron. In an R block in a .qmd, I tried typing Here is the log in the debug console in vscode: Here is the log in the debug console in Positron: I opened the vdoc in the file system and in both cases it was an r file with In both cases these were logged to have the same values. So... the arguments to the following command seem to be the same in both Positron and vscode. |
||
| return await commands.executeCommand<CompletionList>( | ||
| "vscode.executeCompletionItemProvider", | ||
| uri, | ||
| adjustedPosition(language, position), | ||
| trigger | ||
| ); | ||
| }); | ||
| console.log('completions!!!', completions) | ||
|
Collaborator
Author
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. |
||
| return completions.items.map((completion: CompletionItem) => { | ||
| if (language.inject && completion.range) { | ||
| if (completion.range instanceof Range) { | ||
|
|
@@ -49,5 +51,4 @@ export async function vdocCompletions( | |
| } | ||
| return completion; | ||
| }); | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,6 +114,8 @@ async function getCompletions( | |
| return null; | ||
| } | ||
|
|
||
| console.log('getCompletions', completions, [...completions.items]) | ||
|
|
||
|
Comment on lines
+117
to
+118
Collaborator
Author
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. |
||
| // order completions | ||
| const haveOrder = !!completions.items?.[0].sortText; | ||
| if (haveOrder) { | ||
|
|
||




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.
For debugging purposes: re-enable completions in the visual editor in Positron