Skip to content

Commit

Permalink
Merge pull request #934 from appworks-lab/fix/ast-parser-error
Browse files Browse the repository at this point in the history
  • Loading branch information
GiveMe-A-Name authored Aug 9, 2021
2 parents b561b06 + 6f4fc2a commit fee2ad2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions extensions/material-helper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 1.0.9

- fix: the code in the editor is incomplete will cause the AST parser error.

## 1.0.8

- fix: update code snippets, the snippet - mtop.[request | config] => mtop[Request | Config]
Expand Down
2 changes: 1 addition & 1 deletion extensions/material-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Component Helper",
"description": "Easily use Component in React/Vue/Rax.",
"publisher": "iceworks-team",
"version": "1.0.8",
"version": "1.0.9",
"main": "./build/extension.js",
"engines": {
"vscode": "^1.41.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default (doc: vscode.TextDocument): Set<string> => {
const ast = parse(documentText, {
sourceType: 'module',
plugins: getBabelParserPlugins('jsx'),
errorRecovery: true,
});
traverse(ast, {
ImportDeclaration(path: NodePath<ImportDeclaration>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default (code: string, uri: vscode.Uri): string => {
const ast = parse(code, {
sourceType: 'module',
plugins: getBabelParserPlugins('jsx'),
errorRecovery: true,
});

const propTypesDependentName = getImportDependentName(ast, 'prop-types');
Expand Down

0 comments on commit fee2ad2

Please sign in to comment.