Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #175: add missing enums for the AST node types. To match [email protected] values. #176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions fixtures/e2e/_variables.scss
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
$variable: 'value';
$variable2: min-width 1200px;
2 changes: 2 additions & 0 deletions fixtures/e2e/definition/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
content: $variable + function();

@include mixin();

@media ($variable2) {};
}
6 changes: 6 additions & 0 deletions src/unsafe/test/e2e/suite/definition/definitions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ describe('SCSS Definition Test', () => {
await testDefinition(docUri, position(2, 13), expectedLocation);
});

it('should find definition for variables in media', async () => {
const expectedDocumentUri = getDocUri('_variables.scss');
const expectedLocation = sameLineLocation(expectedDocumentUri, 2, 1, 11);
await testDefinition(docUri, position(6, 12), expectedLocation);
});

it('should find definition for functions', async () => {
const expectedDocumentUri = getDocUri('_functions.scss');
const expectedLocation = sameLineLocation(expectedDocumentUri, 1, 1, 9);
Expand Down
16 changes: 14 additions & 2 deletions src/unsafe/types/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export enum NodeType {
For,
Each,
While,
MixinContent,
MixinContentReference,
MixinContentDeclaration,
Media,
Keyframe,
FontFace,
Expand All @@ -67,7 +68,18 @@ export enum NodeType {
AtApplyRule,
CustomPropertyDeclaration,
CustomPropertySet,
ListEntry
ListEntry,
Supports,
SupportsCondition,
NamespacePrefix,
GridLine,
Plugin,
UnknownAtRule,
Use,
ModuleConfiguration,
Forward,
ForwardVisibility,
Module
}

export interface INode {
Expand Down
Loading