mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Find tagless JSDoc as preceding token (#39912)
This commit is contained in:
parent
2ebdf9fdce
commit
7f4e1b699a
@ -1217,6 +1217,10 @@ namespace ts {
|
||||
}
|
||||
|
||||
const children = n.getChildren(sourceFile);
|
||||
if (children.length === 0) {
|
||||
return n;
|
||||
}
|
||||
|
||||
const candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length, sourceFile);
|
||||
return candidate && findRightmostToken(candidate, sourceFile);
|
||||
}
|
||||
|
||||
17
tests/cases/fourslash/completionsAfterJSDoc.ts
Normal file
17
tests/cases/fourslash/completionsAfterJSDoc.ts
Normal file
@ -0,0 +1,17 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////export interface Foo {
|
||||
//// /** JSDoc */
|
||||
//// /**/foo(): void;
|
||||
////}
|
||||
|
||||
// Should not crash, #35632
|
||||
verify.completions({
|
||||
marker: "",
|
||||
isNewIdentifierLocation: true,
|
||||
exact: [{
|
||||
name: "readonly",
|
||||
kind: "keyword",
|
||||
sortText: completion.SortText.GlobalsOrKeywords
|
||||
}]
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user