Skip to content

Commit

Permalink
updated for a property name confilict.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kray-G committed Feb 12, 2021
1 parent 76f21c9 commit 5909a82
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,15 +426,16 @@ class KinxLanguageServer {
if (this.scope_.length > 0 && (type === "public" || type === "class")) {
let scope = this.scope_[this.scope_.length - 1].name;
this.methods_[uri][scope] ??= {}
this.methods_[uri][scope][text] = {
this.methods_[uri][scope][':'+text] = {
kind: CompletionItemKind.Method,
args: args,
retTypename: retTypename
};
return this.methods_[uri][scope][text];
return this.methods_[uri][scope][':'+text];
}

this.symbols_[uri][text] = {
this.symbols_[uri][':'+text] ??= {}
this.symbols_[uri][':'+text] = {
kind: this.utils_.isUpperCase(text.charAt(0)) ? CompletionItemKind.Class : CompletionItemKind.Variable
};
return null;
Expand All @@ -445,8 +446,8 @@ class KinxLanguageServer {
while (types.length > 0) {
let typename: string | undefined = types.pop();
if (typename != null) {
if (this.methods_[uri] && this.methods_[uri][typename] && this.methods_[uri][typename][methodName]) {
return this.methods_[uri][typename][methodName];
if (this.methods_[uri] && this.methods_[uri][typename] && this.methods_[uri][typename][':'+methodName]) {
return this.methods_[uri][typename][':'+methodName];
}
if (this.inheritMap_[uri].hasOwnProperty(typename)) {
Object.keys(this.inheritMap_[uri][typename]).forEach((name: string) => {
Expand Down Expand Up @@ -780,10 +781,12 @@ class KinxLanguageServer {
}
}

this.symbols_[uri] = Object.keys(this.symbols_[uri]).map((name: string) => ({
name: name,
kind: this.symbols_[uri][name].kind,
}));
this.symbols_[uri] = Object.keys(this.symbols_[uri]).map((name: string) => {
return {
name: name.substring(1),
kind: this.symbols_[uri][name].kind,
};
});

return tokens;
}
Expand Down Expand Up @@ -900,7 +903,7 @@ class KinxLanguageServer {
}
if (this.methods_[uri].hasOwnProperty(typename)) {
Object.keys(this.methods_[uri][typename]).forEach((method: string) => {
methods[method] = true;
methods[method.substring(1)] = true;
});
}
if (predefinedMethods.hasOwnProperty(typename)) {
Expand Down

0 comments on commit 5909a82

Please sign in to comment.