Fix: server crash on semantic hightlight request
This commit is contained in:
parent
2a1c4709ff
commit
4d17b328f7
|
@ -14,10 +14,10 @@ class CMakeInfo {
|
|||
public major: number;
|
||||
public minor: number;
|
||||
public patch: number;
|
||||
public modules: string[];
|
||||
public policies: string[];
|
||||
public variables: string[];
|
||||
public properties: string[];
|
||||
public modules: string[] = [];
|
||||
public policies: string[] = [];
|
||||
public variables: string[] = [];
|
||||
public properties: string[] = [];
|
||||
|
||||
public async init() {
|
||||
[
|
||||
|
|
|
@ -67,15 +67,15 @@ export function getTokenBuilder(uri: string): SemanticTokensBuilder {
|
|||
}
|
||||
|
||||
export function getTokenTypes(): string[] {
|
||||
tokenTypes = tokenTypes.filter((value, index, arr) => {
|
||||
return initParams.capabilities.textDocument.semanticTokens.tokenTypes.includes(value);
|
||||
tokenTypes = tokenTypes.filter(value => {
|
||||
return initParams.capabilities.textDocument?.semanticTokens?.tokenTypes.includes(value);
|
||||
});
|
||||
return tokenTypes;
|
||||
}
|
||||
|
||||
export function getTokenModifiers(): string[] {
|
||||
tokenModifiers = tokenModifiers.filter((value, index, arr) => {
|
||||
return initParams.capabilities.textDocument.semanticTokens.tokenModifiers.includes(value);
|
||||
tokenModifiers = tokenModifiers.filter(value => {
|
||||
return initParams.capabilities.textDocument?.semanticTokens?.tokenModifiers.includes(value);
|
||||
});
|
||||
return tokenModifiers;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue