π Search Terms
jsdoc link name
π Version & Regression Information
- This changed between versions 6 and 7
β― Playground Link
Playground Link
π» Code
/**
* {@link #toggled} property
*/
export const x = 1;
π Actual behavior
Using the TS API to get the name jsdoc link tag produces node containing JSDocText property (the next sibling node)
import { API } from "@typescript/native-preview/unstable/sync";
import { createVirtualFileSystem } from "@typescript/native-preview/unstable/fs";
const code = `/**
* {@link #toggled} property
*/
export const x = 1;`;
const api = new API({
fs: createVirtualFileSystem({
"/tsconfig.json": "{}",
"/src/sample.ts": code,
}),
});
const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" });
const project = snapshot.getProject("/tsconfig.json")!;
const sourceFile = project.program.getSourceFile("/src/sample.ts")!;
const statement = sourceFile.statements[0];
// Should be undefined. Returns `property`
console.log(statement.jsDoc[0].comment[1].name?.getText())
π Expected behavior
The name property of the link should be undefined as in 6.0
import ts from "typescript";
const code = `/**
* {@link #toggled} property
*/
export const x = 1;`;
const file = ts.createSourceFile("sample.ts", code, ts.ScriptTarget.Latest, true);
const statement = file.statements[0];
// undefined, since #toggle is not a valid entity name
console.log(statement.jsDoc[0].comment[1].name?.getText());
Additional information about the issue
No response
π Search Terms
jsdoc link name
π Version & Regression Information
β― Playground Link
Playground Link
π» Code
π Actual behavior
Using the TS API to get the name jsdoc link tag produces node containing JSDocText property (the next sibling node)
π Expected behavior
The name property of the link should be undefined as in 6.0
Additional information about the issue
No response