Skip to content

Commit

Permalink
Add support to new import statement v3; Modify importReactorCommand s…
Browse files Browse the repository at this point in the history
…tring to support new statement;
  • Loading branch information
vinzbarbuto committed Sep 12, 2024
1 parent a58711b commit 6b5b2f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/lfview/lf-data-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export class LFDataProvider implements vscode.TreeDataProvider<LFDataProviderNod
return;
}
const relativePath = this.getRelativePath(editor.document.uri.fsPath, node.uri.fsPath);
const importText = `import ${node.label!.toString()} from "${relativePath}"\n`;
const importText = `import ${node.label!.toString()} from <${relativePath}>\n`;
const position = await this.getTargetPosition(editor.document.uri);
this.addTextOnActiveEditor(editor, position!.end, importText);
}
Expand Down
10 changes: 3 additions & 7 deletions syntaxes/lflang.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
},
"import-statement": {
"begin": "(?=^\\s*import\\b)",
"end": ";|(?<=\")\\s*$",
"end": ";|(?<=\")\\s*$|(?<=>)\\s*$",
"patterns": [
{
"include": "#context-insensitive"
Expand All @@ -301,13 +301,9 @@
]
},
{
"begin": "(?<=from)\\s*(\"|<)",
"end": "(\"|>)",
"begin": "(?<=from)\\s*(<)",
"end": "(>)",
"patterns": [
{
"name": "string.quoted.double.lflang",
"match": "(?<=\").*?(?=\")"
},
{
"name": "string.quoted.angle.lflang",
"match": "(?<=<).*?(?=>)"
Expand Down

0 comments on commit 6b5b2f7

Please sign in to comment.