File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
packages/jupyterlab-lsp/src/features/completion Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ Filters Completions In Case Sensitive Mode
3838
3939
4040Can Prioritize Kernel Completions
41- Configure JupyterLab Plugin {"kernelCompletionsFirst": true, "kernelResponseTimeout": -1} plugin id=${COMPLETION PLUGIN ID }
41+ # note: disabling pre-filtering to get ranking without match scoring
42+ Configure JupyterLab Plugin {"kernelCompletionsFirst": true, "kernelResponseTimeout": -1, "preFilterMatches": false} plugin id=${COMPLETION PLUGIN ID }
4243 Enter Cell Editor 1 line=2
4344 Trigger Completer
4445 Completer Should Suggest %%timeit
@@ -47,7 +48,8 @@ Can Prioritize Kernel Completions
4748 Should Be True ${kernel_position } < ${lsp_position }
4849
4950Can Prioritize LSP Completions
50- Configure JupyterLab Plugin {"kernelCompletionsFirst": false, "kernelResponseTimeout": -1} plugin id=${COMPLETION PLUGIN ID }
51+ # note: disabling pre-filtering to get ranking without match scoring
52+ Configure JupyterLab Plugin {"kernelCompletionsFirst": false, "kernelResponseTimeout": -1, "preFilterMatches": false} plugin id=${COMPLETION PLUGIN ID }
5153 Enter Cell Editor 1 line=2
5254 Trigger Completer
5355 Completer Should Suggest %%timeit
Original file line number Diff line number Diff line change @@ -54,7 +54,15 @@ export class GenericCompleterModel<
5454 // set initial query to pre-filter items; in future we should use:
5555 // https://github.com/jupyterlab/jupyterlab/issues/9763#issuecomment-1001603348
5656 const { start, end } = this . cursor ;
57- this . query = this . current . text . substring ( start , end ) ;
57+ let query = this . current . text . substring ( start , end ) . trim ( ) ;
58+ // special case for "Completes Paths In Strings" test case
59+ if ( query . startsWith ( '"' ) || query . startsWith ( "'" ) ) {
60+ query = query . substring ( 1 ) ;
61+ }
62+ if ( query . endsWith ( '"' ) || query . endsWith ( "'" ) ) {
63+ query = query . substring ( 0 , - 1 ) ;
64+ }
65+ this . query = query ;
5866 }
5967 }
6068
You can’t perform that action at this time.
0 commit comments