提交 04067138 编写于 作者: M Matt Bierner

Strict null check snippetVariables

上级 6448b30f
......@@ -355,6 +355,7 @@
"./vs/editor/contrib/smartSelect/tokenSelectionSupport.ts",
"./vs/editor/contrib/smartSelect/tokenTree.ts",
"./vs/editor/contrib/snippet/snippetParser.ts",
"./vs/editor/contrib/snippet/snippetVariables.ts",
"./vs/editor/contrib/suggest/suggest.ts",
"./vs/editor/contrib/suggest/wordContextKey.ts",
"./vs/editor/contrib/suggest/wordDistance.ts",
......
......@@ -68,7 +68,7 @@ export class SelectionBasedVariableResolver implements VariableResolver {
if (name === 'SELECTION' || name === 'TM_SELECTED_TEXT') {
let value = this._model.getValueInRange(this._selection) || undefined;
if (value && this._selection.startLineNumber !== this._selection.endLineNumber) {
if (value && this._selection.startLineNumber !== this._selection.endLineNumber && variable.snippet) {
// Selection is a multiline string which we indentation we now
// need to adjust. We compare the indentation of this variable
// with the indentation at the editor position and add potential
......@@ -83,7 +83,7 @@ export class SelectionBasedVariableResolver implements VariableResolver {
return false;
}
if (marker instanceof Text) {
varLeadingWhitespace = getLeadingWhitespace(marker.value.split(/\r\n|\r|\n/).pop());
varLeadingWhitespace = getLeadingWhitespace(marker.value.split(/\r\n|\r|\n/).pop()!);
}
return true;
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册