-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: scoping for references to own static members (#582)
Closes partially #540 ### Summary of Changes Member accesses to * own static attributes, * own nested classes, * own nested enums, * own static methods, * enum variants are now resolved properly.
- Loading branch information
1 parent
3e88f02
commit 38afc07
Showing
47 changed files
with
705 additions
and
182 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { isSdsAttribute, isSdsClass, isSdsEnum, isSdsFunction, SdsClassMember, SdsImport } from '../generated/ast.js'; | ||
|
||
export const isStatic = (node: SdsClassMember): boolean => { | ||
if (isSdsClass(node) || isSdsEnum(node)) { | ||
return true; | ||
} else if (isSdsAttribute(node)) { | ||
return node.static; | ||
} else if (isSdsFunction(node)) { | ||
return node.static; | ||
} else { | ||
/* c8 ignore next 2 */ | ||
return false; | ||
} | ||
}; | ||
|
||
export const isWildcardImport = function (node: SdsImport): boolean { | ||
const importedNamespace = node.importedNamespace ?? ''; | ||
return importedNamespace.endsWith('*'); | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.