File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 18131813 "title" : " %java.server.restart%" ,
18141814 "category" : " Java"
18151815 },
1816+ {
1817+ "command" : " java.runtime.restartIntellisense" ,
1818+ "title" : " Restart IntelliSense for Active File" ,
1819+ "category" : " Java"
1820+ },
18161821 {
18171822 "command" : " java.action.filesExplorerPasteAction" ,
18181823 "title" : " %java.action.filesExplorerPasteAction%" ,
19411946 "command" : " java.action.showTypeHierarchy" ,
19421947 "when" : " javaLSReady && editorTextFocus && editorLangId == java" ,
19431948 "group" : " 0_navigation@3"
1949+ },
1950+ {
1951+ "command" : " java.runtime.restartIntellisense" ,
1952+ "when" : " editorTextFocus && editorLangId == java" ,
1953+ "group" : " navigation@91"
19441954 }
19451955 ],
19461956 "commandPalette" : [
Original file line number Diff line number Diff line change @@ -284,6 +284,7 @@ export namespace Commands {
284284 * Command to restart the language server.
285285 */
286286 export const RESTART_LANGUAGE_SERVER = 'java.server.restart' ;
287+ export const RESTART_INTELLISENSE_FOR_ACTIVE_FILE = 'java.runtime.restartIntellisense' ;
287288
288289 export const LEARN_MORE_ABOUT_REFACTORING = '_java.learnMoreAboutRefactorings' ;
289290
Original file line number Diff line number Diff line change @@ -1270,6 +1270,13 @@ function registerRestartJavaLanguageServerCommand(context: ExtensionContext) {
12701270 break ;
12711271 }
12721272 } ) ) ;
1273+ context . subscriptions . push ( commands . registerCommand ( Commands . RESTART_INTELLISENSE_FOR_ACTIVE_FILE , async ( ) => {
1274+ const editor = window . activeTextEditor ;
1275+ if ( ! editor || editor . document . languageId !== "java" ) {
1276+ return ;
1277+ }
1278+ await commands . executeCommand ( Commands . RESTART_LANGUAGE_SERVER ) ;
1279+ } ) ) ;
12731280}
12741281
12751282function escapeSnippetLiterals ( value : string ) : string {
You can’t perform that action at this time.
0 commit comments