Update the end of import declaration at the new line as well as end of the line
Fixes #485
This commit is contained in:
Родитель
5ef90653db
Коммит
648a036db2
|
@ -343,7 +343,7 @@ repository:
|
|||
'2': { name: keyword.control.import.ts }
|
||||
'3': { name: variable.other.readwrite.alias.ts }
|
||||
'4': { name: keyword.operator.assignment.ts }
|
||||
end: (?=;|$)
|
||||
end: (?=;|$|^)
|
||||
patterns:
|
||||
- include: '#comment'
|
||||
- match: ([_$[:alpha:]][_$[:alnum:]]*)\s*(\.)
|
||||
|
@ -359,7 +359,7 @@ repository:
|
|||
beginCaptures:
|
||||
'1': { name: keyword.control.export.ts }
|
||||
'2': { name: keyword.control.import.ts }
|
||||
end: (?=;|$)
|
||||
end: (?=;|$|^)
|
||||
patterns:
|
||||
- include: '#import-export-declaration'
|
||||
|
||||
|
|
|
@ -1052,7 +1052,7 @@
|
|||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(?=;|$)</string>
|
||||
<string>(?=;|$|^)</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
@ -1106,7 +1106,7 @@
|
|||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(?=;|$)</string>
|
||||
<string>(?=;|$|^)</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
|
|
@ -1056,7 +1056,7 @@
|
|||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(?=;|$)</string>
|
||||
<string>(?=;|$|^)</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
@ -1110,7 +1110,7 @@
|
|||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(?=;|$)</string>
|
||||
<string>(?=;|$|^)</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
import a from 'a' // test
|
||||
import b from 'b'
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
-----------------------------------
|
||||
>import a from 'a' // test
|
||||
^^^^^^
|
||||
source.ts meta.import.ts keyword.control.import.ts
|
||||
^
|
||||
source.ts meta.import.ts
|
||||
^
|
||||
source.ts meta.import.ts variable.other.readwrite.alias.ts
|
||||
^
|
||||
source.ts meta.import.ts
|
||||
^^^^
|
||||
source.ts meta.import.ts keyword.control.from.ts
|
||||
^
|
||||
source.ts meta.import.ts
|
||||
^
|
||||
source.ts meta.import.ts string.quoted.single.ts punctuation.definition.string.begin.ts
|
||||
^
|
||||
source.ts meta.import.ts string.quoted.single.ts
|
||||
^
|
||||
source.ts meta.import.ts string.quoted.single.ts punctuation.definition.string.end.ts
|
||||
^
|
||||
source.ts meta.import.ts
|
||||
^^
|
||||
source.ts meta.import.ts comment.line.double-slash.ts punctuation.definition.comment.ts
|
||||
^^^^^^^
|
||||
source.ts meta.import.ts comment.line.double-slash.ts
|
||||
>import b from 'b'
|
||||
^^^^^^
|
||||
source.ts meta.import.ts keyword.control.import.ts
|
||||
^
|
||||
source.ts meta.import.ts
|
||||
^
|
||||
source.ts meta.import.ts variable.other.readwrite.alias.ts
|
||||
^
|
||||
source.ts meta.import.ts
|
||||
^^^^
|
||||
source.ts meta.import.ts keyword.control.from.ts
|
||||
^
|
||||
source.ts meta.import.ts
|
||||
^
|
||||
source.ts meta.import.ts string.quoted.single.ts punctuation.definition.string.begin.ts
|
||||
^
|
||||
source.ts meta.import.ts string.quoted.single.ts
|
||||
^
|
||||
source.ts meta.import.ts string.quoted.single.ts punctuation.definition.string.end.ts
|
|
@ -0,0 +1,2 @@
|
|||
import a from 'a' // test
|
||||
import b from 'b'
|
Загрузка…
Ссылка в новой задаче