File tree Expand file tree Collapse file tree
vs/workbench/parts/snippets/electron-browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change 671671 " ./vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts" ,
672672 " ./vs/workbench/parts/snippets/electron-browser/snippetsFile.ts" ,
673673 " ./vs/workbench/parts/snippets/electron-browser/snippetsService.ts" ,
674+ " ./vs/workbench/parts/snippets/electron-browser/tabCompletion.ts" ,
674675 " ./vs/workbench/parts/snippets/test/electron-browser/snippetFile.test.ts" ,
675676 " ./vs/workbench/parts/snippets/test/electron-browser/snippetsRegistry.test.ts" ,
676677 " ./vs/workbench/parts/snippets/test/electron-browser/snippetsRewrite.test.ts" ,
812813 " ./vs/workbench/services/keybinding/test/macLinuxFallbackKeyboardMapper.test.ts" ,
813814 " ./vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts" ,
814815 " ./vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts" ,
816+ " ./vs/workbench/services/label/common/labelService.ts" ,
815817 " ./vs/workbench/services/mode/common/workbenchModeService.ts" ,
816818 " ./vs/workbench/services/notification/common/notificationService.ts" ,
817819 " ./vs/workbench/services/panel/common/panelService.ts" ,
Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ export class TabCompletionController implements editorCommon.IEditorContribution
7878 // reset first
7979 this . _activeSnippets = [ ] ;
8080
81+ if ( ! this . _editor . hasModel ( ) ) {
82+ return ;
83+ }
84+
8185 // lots of dance for getting the
8286 const selection = this . _editor . getSelection ( ) ;
8387 const model = this . _editor . getModel ( ) ;
@@ -118,6 +122,9 @@ export class TabCompletionController implements editorCommon.IEditorContribution
118122 }
119123
120124 performSnippetCompletions ( ) : void {
125+ if ( ! this . _editor . hasModel ( ) ) {
126+ return ;
127+ }
121128
122129 if ( this . _activeSnippets . length === 1 ) {
123130 // one -> just insert
@@ -126,8 +133,8 @@ export class TabCompletionController implements editorCommon.IEditorContribution
126133
127134 } else if ( this . _activeSnippets . length > 1 ) {
128135 // two or more -> show IntelliSense box
136+ const position = this . _editor . getPosition ( ) ;
129137 showSimpleSuggestions ( this . _editor , this . _activeSnippets . map ( snippet => {
130- const position = this . _editor . getPosition ( ) ;
131138 const range = Range . fromPositions ( position . delta ( 0 , - snippet . prefix . length ) , position ) ;
132139 return new SnippetCompletion ( snippet , range ) ;
133140 } ) ) ;
You can’t perform that action at this time.
0 commit comments