{"id":109396,"date":"2026-09-24T02:24:50","date_gmt":"2026-09-23T18:24:50","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/109396.html"},"modified":"2026-09-24T02:24:50","modified_gmt":"2026-09-23T18:24:50","slug":"%e4%bd%bf%e7%94%a8-diagnostic-related-information-%e5%a2%9e%e5%bc%ba-vs-code-%e6%89%a9%e5%b1%95%e8%af%8a%e6%96%ad%e4%bf%a1%e6%81%af%ef%bc%9adiagnostic-related-information-sample-%e6%b7%b1%e5%ba%a6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/109396.html","title":{"rendered":"\u4f7f\u7528 Diagnostic Related Information \u589e\u5f3a VS Code \u6269\u5c55\u8bca\u65ad\u4fe1\u606f\uff1adiagnostic-related-information-sample \u6df1\u5ea6\u89e3\u6790"},"content":{"rendered":"<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u793a\u4f8b\u5de5\u7a0b<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011vscode-extension-samples<\/h3>\n<p class=\"gcb-project-desc\">Sample code illustrating the VS Code extension API.<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/gh_mirrors\/vs\/vscode-extension-samples<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<h3>\u5bfc\u8bfb<\/h3>\n<p>\u672c\u6587\u4ee5 vscode-extension-samples \u4ed3\u5e93\u4e2d\u7684 diagnostic-related-information-sample \u4e3a\u84dd\u672c&#xff0c;\u7cfb\u7edf\u8bb2\u89e3\u5982\u4f55\u5728 VS Code \u6269\u5c55\u4e2d\u4e3a Diagnostic&#xff08;\u8bca\u65ad\u4fe1\u606f&#xff09;\u9644\u52a0 relatedInformation&#xff08;\u5173\u8054\u4fe1\u606f&#xff09;\u3002\u901a\u8fc7\u9605\u8bfb\u672c\u6587&#xff0c;\u4f60\u5c06\u638c\u63e1 vscode.languages.createDiagnosticCollection\u3001vscode.DiagnosticRelatedInformation \u4e0e vscode.Location \u7684\u7ec4\u5408\u7528\u6cd5&#xff0c;\u5b66\u4f1a\u8ba9\u300c\u9519\u8bef\u63d0\u793a\u300d\u643a\u5e26\u300c\u4e0a\u4e0b\u6587\u7ebf\u7d22\u300d&#xff08;\u4f8b\u5982\u6307\u51fa\u53d8\u91cf\u9996\u6b21\u8d4b\u503c\u7684\u4f4d\u7f6e&#xff09;&#xff0c;\u5e76\u7406\u89e3\u8fd9\u4e9b\u4fe1\u606f\u5728 Problems \u89c6\u56fe\u4e0e\u7f16\u8f91\u5668\u4e2d\u5982\u4f55\u8054\u52a8\u5c55\u793a\u3002<\/p>\n<h3>\u793a\u4f8b\u6982\u89c8&#xff1a;\u8bca\u65ad\u4fe1\u606f\u4e2d\u7684\u201c\u4e0a\u4e0b\u6587\u5173\u8054\u201d<\/h3>\n<p>VS Code \u7684\u6269\u5c55 API \u5141\u8bb8\u6269\u5c55\u901a\u8fc7\u8bca\u65ad\u96c6\u5408&#xff08;Diagnostic Collection&#xff09;\u5411 Problems \u89c6\u56fe\u548c\u7f16\u8f91\u5668\u6ce8\u5165\u9519\u8bef\u3001\u8b66\u544a\u7b49\u4fe1\u606f\u3002\u5e38\u89c4\u8bca\u65ad\u53ea\u80fd\u63cf\u8ff0\u300c\u54ea\u91cc\u51fa\u9519\u4e86\u300d&#xff0c;\u800c DiagnosticRelatedInformation \u80fd\u8ba9\u9519\u8bef\u6761\u76ee\u9644\u5e26\u4e00\u6761\u6216\u591a\u6761\u5173\u8054\u4f4d\u7f6e\u4fe1\u606f&#xff0c;\u628a\u8bfb\u8005\u4ece\u51fa\u9519\u70b9\u5f15\u5bfc\u5230\u4ea7\u751f\u95ee\u9898\u7684\u6839\u6e90\u4f4d\u7f6e\u3002<\/p>\n<p>\u672c\u793a\u4f8b\u6a21\u62df\u4e86\u4e00\u4e2a Rust \u573a\u666f&#xff1a;\u5bf9\u4e0d\u53ef\u53d8\u53d8\u91cf x \u8fdb\u884c\u4e8c\u6b21\u8d4b\u503c\u3002\u793a\u4f8b\u751f\u6210\u7684\u9519\u8bef\u4f4d\u4e8e\u7b2c 4 \u884c&#xff08;x &#061; 6;&#xff09;&#xff0c;\u800c\u5173\u8054\u4fe1\u606f\u5219\u6307\u5411\u7b2c 2 \u884c&#xff08;let x &#061; 5;&#xff09;&#xff0c;\u5373\u53d8\u91cf x \u7684\u9996\u6b21\u8d4b\u503c\u4f4d\u7f6e\u3002\u8fd0\u884c\u6548\u679c\u5982\u4e0b&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260923182449-6ab4197118273.png\" alt=\"Multi Diagnostics\uff1aProblems \u89c6\u56fe\u4e2d\u5e26\u6709\u5173\u8054\u4fe1\u606f\u7684\u8bca\u65ad\u6761\u76ee\" \/><\/p>\n<h3>\u6e90\u7801\u5256\u6790&#xff1a;\u8bca\u65ad\u5982\u4f55\u88ab\u751f\u6210<\/h3>\n<p>\u793a\u4f8b\u7684\u6838\u5fc3\u903b\u8f91\u5168\u90e8\u4f4d\u4e8e src\/extension.ts&#xff0c;\u4ee3\u7801\u975e\u5e38\u7cbe\u7b80&#xff0c;\u5374\u5b8c\u6574\u8986\u76d6\u4e86\u300c\u521b\u5efa\u8bca\u65ad\u96c6\u5408 \u2192 \u76d1\u542c\u7f16\u8f91\u5668\u5207\u6362 \u2192 \u6309\u6587\u6863\u751f\u6210\u8bca\u65ad \u2192 \u6e05\u7406\u8bca\u65ad\u300d\u7684\u5168\u6d41\u7a0b\u3002<\/p>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u521b\u5efa\u8bca\u65ad\u96c6\u5408<\/h4>\n<p>const collection &#061; vscode.languages.createDiagnosticCollection(&#039;test&#039;);<\/p>\n<p>createDiagnosticCollection \u8fd4\u56de\u4e00\u4e2a DiagnosticCollection&#xff0c;\u5176\u4e2d\u7684\u5b57\u7b26\u4e32\u53c2\u6570\u662f\u96c6\u5408\u540d\u79f0&#xff08;\u8fd9\u91cc\u4e3a &#039;test&#039;&#xff09;\u3002\u8bca\u65ad\u96c6\u5408\u7528\u4e8e\u7ba1\u7406\u4e00\u7ec4\u6587\u6863\u4e0e\u5176\u8bca\u65ad\u7ed3\u679c\u7684\u6620\u5c04&#xff0c;\u6269\u5c55\u53ef\u4ee5\u5c06\u96c6\u5408\u63a8\u5165 context.subscriptions \u4ee5\u4fbf\u968f\u6269\u5c55\u505c\u7528\u81ea\u52a8\u91ca\u653e\u3002<\/p>\n<p>\u7c7b\u4f3c\u7684\u7528\u6cd5\u4e5f\u51fa\u73b0\u5728 code-actions-sample \u4e2d\u2014\u2014\u5b83\u521b\u5efa\u4e86\u540d\u4e3a &#034;emoji&#034; \u7684\u8bca\u65ad\u96c6\u5408\u5e76\u7acb\u5373 subscriptions.push(emojiDiagnostics)&#xff0c;\u53ef\u89c1\u300c\u521b\u5efa\u96c6\u5408 &#043; \u767b\u8bb0\u8ba2\u9605\u300d\u662f\u6807\u51c6\u5957\u8def\u3002<\/p>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u76d1\u542c\u5f53\u524d\u7f16\u8f91\u5668\u53d8\u5316<\/h4>\n<p>if (vscode.window.activeTextEditor) {<br \/>\n    updateDiagnostics(vscode.window.activeTextEditor.document, collection);<br \/>\n}<br \/>\ncontext.subscriptions.push(vscode.window.onDidChangeActiveTextEditor(editor &#061;&gt; {<br \/>\n    if (editor) {<br \/>\n        updateDiagnostics(editor.document, collection);<br \/>\n    }<br \/>\n}));<\/p>\n<p>\u6269\u5c55\u6fc0\u6d3b\u65f6&#xff0c;\u5148\u5bf9\u5f53\u524d\u6d3b\u52a8\u7f16\u8f91\u5668\u8c03\u7528\u4e00\u6b21 updateDiagnostics&#xff1b;\u968f\u540e\u901a\u8fc7 onDidChangeActiveTextEditor \u8ba2\u9605\u7f16\u8f91\u5668\u5207\u6362\u4e8b\u4ef6&#xff0c;\u5728\u7528\u6237\u5207\u6362\u6807\u7b7e\u9875\u65f6\u540c\u6b65\u66f4\u65b0\u8bca\u65ad\u3002\u6ce8\u610f context.subscriptions.push \u5c06\u4e8b\u4ef6\u8ba2\u9605\u6ce8\u518c\u8fdb\u6269\u5c55\u4e0a\u4e0b\u6587&#xff0c;VS Code \u4f1a\u5728\u6269\u5c55\u505c\u7528\u65f6\u81ea\u52a8\u6ce8\u9500\u8fd9\u4e9b\u8ba2\u9605\u3002<\/p>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u6309\u6587\u6863\u8fc7\u6ee4\u5e76\u5199\u5165\u8bca\u65ad<\/h4>\n<p>function updateDiagnostics(document: vscode.TextDocument, collection: vscode.DiagnosticCollection): void {<br \/>\n    if (document &amp;&amp; path.basename(document.uri.fsPath) &#061;&#061;&#061; &#039;sample-demo.rs&#039;) {<br \/>\n        collection.set(document.uri, [{<br \/>\n            code: &#039;&#039;,<br \/>\n            message: &#039;cannot assign twice to immutable variable &#096;x&#096;&#039;,<br \/>\n            range: new vscode.Range(new vscode.Position(3, 4), new vscode.Position(3, 10)),<br \/>\n            severity: vscode.DiagnosticSeverity.Error,<br \/>\n            source: &#039;&#039;,<br \/>\n            relatedInformation: [<br \/>\n                new vscode.DiagnosticRelatedInformation(<br \/>\n                    new vscode.Location(document.uri, new vscode.Range(new vscode.Position(1, 8), new vscode.Position(1, 9))),<br \/>\n                    &#039;first assignment to &#096;x&#096;&#039;<br \/>\n                )<br \/>\n            ]<br \/>\n        }]);<br \/>\n    } else {<br \/>\n        collection.clear();<br \/>\n    }<br \/>\n}<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u662f\u672c\u793a\u4f8b\u7684\u6838\u5fc3&#xff0c;\u9010\u9879\u8bf4\u660e&#xff1a;<\/p>\n<table>\n<tr>\u5b57\u6bb5\u503c\u542b\u4e49<\/tr>\n<tbody>\n<tr>\n<td>code<\/td>\n<td>&#039;&#039;<\/td>\n<td>\u8bca\u65ad\u7684\u9519\u8bef\u7801&#xff08;\u53ef\u7559\u7a7a&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>message<\/td>\n<td>&#039;cannot assign twice to immutable variablex&#039;<\/td>\n<td>\u4e3b\u8bca\u65ad\u4fe1\u606f&#xff0c;\u5c55\u793a\u5728 Problems \u89c6\u56fe\u4e0e\u7f16\u8f91\u5668\u4e2d<\/td>\n<\/tr>\n<tr>\n<td>range<\/td>\n<td>new Range(new Position(3, 4), new Position(3, 10))<\/td>\n<td>\u4e3b\u8bca\u65ad\u8986\u76d6\u7684\u4f4d\u7f6e&#xff1a;\u7b2c 4 \u884c\u7b2c 5&#xff5e;10 \u5217&#xff0c;\u5373 x &#061; 6; \u4e2d\u7684 x&#xff08;\u884c\u53f7\u4ece 0 \u5f00\u59cb&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>severity<\/td>\n<td>DiagnosticSeverity.Error<\/td>\n<td>\u4e25\u91cd\u7ea7\u522b&#xff0c;\u6b64\u5904\u4e3a\u9519\u8bef<\/td>\n<\/tr>\n<tr>\n<td>source<\/td>\n<td>&#039;&#039;<\/td>\n<td>\u8bca\u65ad\u6765\u6e90\u6807\u8bc6&#xff08;\u53ef\u7559\u7a7a&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>relatedInformation<\/td>\n<td>\u4e00\u4e2a\u5305\u542b DiagnosticRelatedInformation \u7684\u6570\u7ec4<\/td>\n<td>\u5173\u8054\u4fe1\u606f\u5217\u8868&#xff0c;\u53ef\u6302\u8f7d\u591a\u6761<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6ce8\u610f\u5750\u6807\u4f53\u7cfb&#xff1a;Position \u548c Range \u7684\u884c\u5217\u5747\u4ece 0 \u5f00\u59cb&#xff0c;\u56e0\u6b64\u4ee3\u7801\u4e2d Position(3, 4) \u5bf9\u5e94 sample-demo.rs \u6587\u4ef6\u4e2d\u7684\u7b2c 4 \u884c&#xff08;x &#061; 6;&#xff09;&#xff0c;\u800c Position(1, 8) \u5bf9\u5e94\u7b2c 2 \u884c&#xff08;let x &#061; 5;&#xff09;\u4e2d\u7684 x \u5b57\u7b26\u3002<\/p>\n<h4>\u5173\u8054\u4fe1\u606f\u5bf9\u8c61\u7684\u7ed3\u6784<\/h4>\n<p>DiagnosticRelatedInformation \u7684\u6784\u9020\u7b7e\u540d\u662f&#xff1a;<\/p>\n<p>new vscode.DiagnosticRelatedInformation(location: vscode.Location, message: string)<\/p>\n<ul>\n<li>location&#xff1a;vscode.Location \u5bf9\u8c61&#xff0c;\u7531\u300c\u6587\u6863 URI &#043; Range\u300d\u7ec4\u6210&#xff0c;\u672c\u793a\u4f8b\u6307\u5411\u53d8\u91cf\u9996\u6b21\u8d4b\u503c\u7684\u4f4d\u7f6e new vscode.Location(document.uri, new vscode.Range(new vscode.Position(1, 8), new vscode.Position(1, 9)))&#xff1b;<\/li>\n<li>message&#xff1a;\u5173\u8054\u4fe1\u606f\u7684\u6587\u5b57\u8bf4\u660e&#xff0c;\u672c\u793a\u4f8b\u4e3a &#039;first assignment tox&#039;\u3002<\/li>\n<\/ul>\n<p>\u5f53\u4e00\u4e2a\u8bca\u65ad\u5305\u542b\u591a\u6761 relatedInformation \u65f6&#xff0c;Problems \u89c6\u56fe\u4e2d\u8be5\u6761\u8bca\u65ad\u4f1a\u88ab\u81ea\u52a8\u5c55\u5f00\u4e3a\u4e00\u4e2a\u53ef\u6298\u53e0\u7684\u6761\u76ee\u6811&#xff0c;\u5b50\u8282\u70b9\u5373\u5404\u6761\u5173\u8054\u4fe1\u606f&#xff0c;\u70b9\u51fb\u5373\u53ef\u8df3\u8f6c\u5230\u5bf9\u5e94\u4f4d\u7f6e\u3002\u8fd9\u4e5f\u89e3\u91ca\u4e86 README \u4e2d\u300cF8 \u5feb\u901f\u904d\u5386\u9519\u8bef\u65f6\u540c\u6837\u4f1a\u663e\u793a\u5173\u8054\u4fe1\u606f\u300d\u7684\u884c\u4e3a\u2014\u2014F8 \u9519\u8bef\u5bfc\u822a\u590d\u7528\u7684\u662f\u540c\u4e00\u5957\u8bca\u65ad\u6570\u636e\u7ed3\u6784\u3002<\/p>\n<h3>\u89e6\u53d1\u8bca\u65ad\u7684\u6f14\u793a\u6587\u4ef6&#xff1a;sample-demo.rs<\/h3>\n<p>\u793a\u4f8b\u914d\u5957\u7684\u6f14\u793a\u6587\u4ef6 sample-demo.rs \u5185\u5bb9\u5982\u4e0b&#xff1a;<\/p>\n<p>fn main() {<br \/>\n    let x &#061; 5;<br \/>\n    println!(&#034;The value of x is: {}&#034;, x);<br \/>\n    x &#061; 6;<br \/>\n    println!(&#034;The value of x is: {}&#034;, x);<br \/>\n}<\/p>\n<ul>\n<li>\u7b2c 2 \u884c let x &#061; 5; \u58f0\u660e\u4e86\u4e0d\u53ef\u53d8\u53d8\u91cf x \u5e76\u9996\u6b21\u8d4b\u503c&#xff1b;<\/li>\n<li>\u7b2c 4 \u884c x &#061; 6; \u5c1d\u8bd5\u4e8c\u6b21\u8d4b\u503c&#xff0c;\u8fd9\u6b63\u662f\u9519\u8bef\u88ab\u6807\u8bb0\u7684\u4f4d\u7f6e&#xff1b;<\/li>\n<li>\u8bca\u65ad\u8303\u56f4\u7cbe\u786e\u8986\u76d6\u7b2c 4 \u884c\u4e2d\u7684 x&#xff08;\u7b2c 5&#xff5e;10 \u5217&#xff09;&#xff0c;\u800c\u5173\u8054\u4fe1\u606f\u6307\u5411\u7b2c 2 \u884c let x &#061; 5; \u4e2d\u7684 x&#xff08;\u7b2c 9 \u5217&#xff09;&#xff0c;\u5373\u9996\u6b21\u8d4b\u503c\u4f4d\u7f6e\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u79cd\u300c\u9519\u8bef\u5728 A \u5904\u3001\u6839\u6e90\u5728 B \u5904\u300d\u7684\u6a21\u5f0f&#xff0c;\u6b63\u662f relatedInformation \u6700\u5178\u578b\u7684\u4f7f\u7528\u573a\u666f&#xff1a;\u7f16\u8bd1\u5668\/\u9759\u6001\u5206\u6790\u5de5\u5177\u53ef\u4ee5\u5728\u300c\u62a5\u9519\u4f4d\u7f6e\u300d\u548c\u300c\u6839\u56e0\u4f4d\u7f6e\u300d\u4e4b\u95f4\u5efa\u7acb\u53ef\u89c1\u7684\u5bfc\u822a\u94fe\u8def\u3002<\/p>\n<h3>\u73af\u5883\u4e0e\u5de5\u7a0b\u914d\u7f6e<\/h3>\n<p>\u793a\u4f8b\u662f\u4e00\u4e2a\u6807\u51c6\u7684 TypeScript \u6269\u5c55\u5de5\u7a0b&#xff0c;\u5173\u952e\u914d\u7f6e\u5982\u4e0b&#xff1a;<\/p>\n<ul>\n<li>package.json&#xff1a;\n<ul>\n<li>engines.vscode \u4e3a ^1.100.0&#xff0c;\u8868\u660e\u9700\u8981 VS Code 1.100 \u53ca\u4ee5\u4e0a\u7248\u672c&#xff1b;<\/li>\n<li>activationEvents \u4e3a &#034;*&#034;&#xff0c;\u5373\u6269\u5c55\u5728\u4efb\u4f55\u65f6\u5019\u90fd\u53ef\u80fd\u88ab\u6fc0\u6d3b&#xff08;\u672c\u793a\u4f8b\u5728\u7f16\u8f91\u5668\u6253\u5f00\/\u5207\u6362\u65f6\u89e6\u53d1\u8bca\u65ad\u66f4\u65b0&#xff09;&#xff1b;<\/li>\n<li>main \u6307\u5411\u7f16\u8bd1\u4ea7\u7269 .\/out\/extension.js&#xff1b;<\/li>\n<li>\u63d0\u4f9b compile&#xff08;tsc -p .\/&#xff09;\u3001watch&#xff08;tsc -watch -p .\/&#xff09;\u3001lint&#xff08;eslint&#xff09;\u4e09\u4e2a\u811a\u672c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>tsconfig.json&#xff1a;target \u4e3a ES2024&#xff0c;module \u4e3a commonjs&#xff0c;strict \u5f00\u542f&#xff0c;\u6e90\u7801\u7f16\u8bd1\u8f93\u51fa\u5230 out\/ \u76ee\u5f55\u3002<\/li>\n<li>eslint.config.mjs&#xff1a;\u91c7\u7528 typescript-eslint \u63a8\u8350\u89c4\u5219\u4e0e &#064;stylistic \u98ce\u683c\u63d2\u4ef6&#xff0c;\u6392\u9664 out \u4e0e .vscode-test \u76ee\u5f55\u3002<\/li>\n<\/ul>\n<h3>\u8bbe\u7f6e\u4e0e\u6d4b\u8bd5&#xff08;Set up &amp; Test&#xff09;<\/h3>\n<p>\u6309\u7167 README \u7684\u6b65\u9aa4\u5373\u53ef\u672c\u5730\u8fd0\u884c\u9a8c\u8bc1&#xff1a;<\/p>\n<li>\u514b\u9686\u4ed3\u5e93&#xff1a;\u83b7\u53d6\u672c\u4ed3\u5e93\u4ee3\u7801&#xff08;\u4f8b\u5982 git clone https:\/\/gitcode.com\/gh_mirrors\/vs\/vscode-extension-samples&#xff09;&#xff1b;<\/li>\n<li>\u5b89\u88c5\u4f9d\u8d56&#xff1a;\u8fdb\u5165 diagnostic-related-information-sample \u76ee\u5f55\u6267\u884c npm install&#xff1b;<\/li>\n<li>\u542f\u52a8\u6269\u5c55\u5f00\u53d1\u5bbf\u4e3b&#xff1a;\u5728 VS Code \u4e2d\u6309 F5&#xff08;\u6216\u901a\u8fc7\u8fd0\u884c\u4e0e\u8c03\u8bd5\u9762\u677f&#xff09;\u542f\u52a8 Extension Development Host&#xff1b;<\/li>\n<li>\u6253\u5f00\u6f14\u793a\u6587\u4ef6&#xff1a;\u5728\u8be5\u5f00\u53d1\u5bbf\u4e3b\u7a97\u53e3\u4e2d\u6253\u5f00 sample-demo.rs&#xff1b;<\/li>\n<li>\u67e5\u770b Problems \u89c6\u56fe&#xff1a;\u5e95\u90e8 Problems \u9762\u677f\u4f1a\u51fa\u73b0\u4e00\u6761\u9519\u8bef cannot assign twice to immutable variable \\\\x&#096;&#xff0c;\u5c55\u5f00\u540e\u53ef\u89c1\u5173\u8054\u4fe1\u606ffirst assignment to &#096;x&#096;&#096;&#xff1b;<\/li>\n<li>\u4f7f\u7528 F8 \u5bfc\u822a&#xff1a;\u5728\u7f16\u8f91\u5668\u4e2d\u6309 F8 \u904d\u5386\u9519\u8bef&#xff0c;\u540c\u6837\u4f1a\u663e\u793a\u8be5\u9519\u8bef\u53ca\u5176\u5173\u8054\u4fe1\u606f&#xff0c;\u53ef\u76f4\u63a5\u8df3\u8f6c\u5230\u9996\u6b21\u8d4b\u503c\u4f4d\u7f6e\u3002<\/li>\n<p>\u8be5\u793a\u4f8b\u6ca1\u6709\u5b9e\u73b0\u8bed\u8a00\u670d\u52a1\u5668&#xff08;LSP&#xff09;&#xff0c;\u8bca\u65ad\u5b8c\u5168\u7531\u6269\u5c55\u7aef API \u76f4\u63a5\u6ce8\u5165&#xff0c;\u56e0\u6b64\u65e0\u9700\u914d\u7f6e\u5206\u6790\u5668\u6216\u7f16\u8bd1\u5668&#xff0c;\u5f00\u7bb1\u5373\u7528\u3002<\/p>\n<h3>\u5ef6\u4f38&#xff1a;LSP \u573a\u666f\u4e0b\u7684\u5173\u8054\u4fe1\u606f<\/h3>\n<p>relatedInformation \u5e76\u975e\u6269\u5c55 API \u7684\u4e13\u5229\u2014\u2014\u5728\u8bed\u8a00\u670d\u52a1\u5668\u534f\u8bae&#xff08;LSP&#xff09;\u4e2d\u4e5f\u6709\u5bf9\u5e94\u80fd\u529b\u3002\u4ed3\u5e93\u4e2d\u7684 lsp-sample \u5728\u670d\u52a1\u5668\u521d\u59cb\u5316\u65f6\u4f1a\u901a\u8fc7 publishDiagnostics.relatedInformation \u80fd\u529b\u534f\u5546\u5224\u65ad\u5ba2\u6237\u7aef\u662f\u5426\u652f\u6301\u5173\u8054\u4fe1\u606f&#xff0c;\u7136\u540e\u5728\u53d1\u9001\u8bca\u65ad\u65f6\u52a8\u6001\u9644\u52a0&#xff1a;<\/p>\n<p>hasDiagnosticRelatedInformationCapability &#061; !!(<br \/>\n    capabilities.textDocument &amp;&amp;<br \/>\n    capabilities.textDocument.publishDiagnostics &amp;&amp;<br \/>\n    capabilities.textDocument.publishDiagnostics.relatedInformation<br \/>\n);<br \/>\n\/\/ &#8230;<br \/>\nif (hasDiagnosticRelatedInformationCapability) {<br \/>\n    diagnostic.relatedInformation &#061; [<br \/>\n        {<br \/>\n            location: {<br \/>\n                uri: textDocument.uri,<br \/>\n                range: Object.assign({}, diagnostic.range)<br \/>\n            },<br \/>\n            message: &#039;Spelling matters&#039;<br \/>\n        }<br \/>\n    ];<br \/>\n}<\/p>\n<p>\u4ece\u6e90\u7801\u7ed3\u6784\u770b&#xff0c;LSP \u670d\u52a1\u7aef\u5728\u80fd\u529b\u534f\u5546\u901a\u8fc7\u540e&#xff0c;\u624d\u4f1a\u586b\u5145 relatedInformation \u5b57\u6bb5&#xff0c;\u4e0e\u672c\u6587\u793a\u4f8b\u5728\u6269\u5c55\u7aef\u76f4\u63a5\u6784\u9020 DiagnosticRelatedInformation \u5f62\u6210\u4e86\u300c\u6269\u5c55 API \u76f4\u5199\u300d\u4e0e\u300c\u534f\u8bae\u5b57\u6bb5\u586b\u5145\u300d\u4e24\u79cd\u5b9e\u73b0\u8def\u5f84\u7684\u5bf9\u7167\u3002\u5bf9\u4e8e\u8bed\u8a00\u670d\u52a1\u5f00\u53d1\u8005&#xff0c;\u5728\u5b9e\u73b0\u7f16\u8bd1\u5668\u8bca\u65ad\u65f6\u9700\u8981\u540c\u65f6\u8003\u8651\u8fd9\u4e00\u80fd\u529b\u534f\u5546&#xff0c;\u4ee5\u517c\u5bb9\u4e0d\u652f\u6301\u5173\u8054\u4fe1\u606f\u7684\u65e7\u5ba2\u6237\u7aef\u3002<\/p>\n<h3>\u5c0f\u7ed3<\/h3>\n<p>\u901a\u8fc7\u672c\u793a\u4f8b\u53ef\u4ee5\u770b\u5230&#xff0c;\u4e3a\u8bca\u65ad\u9644\u52a0\u5173\u8054\u4fe1\u606f\u53ea\u9700\u4e09\u6b65&#xff1a;\u5b9a\u4f4d\u4e3b\u8bca\u65ad\u7684 Range\u3001\u6784\u9020\u6307\u5411\u6839\u56e0\u4f4d\u7f6e\u7684 Location\u3001\u5c06 DiagnosticRelatedInformation \u586b\u5165\u8bca\u65ad\u5bf9\u8c61\u7684 relatedInformation \u6570\u7ec4\u3002\u8fd9\u79cd\u673a\u5236\u8ba9\u6269\u5c55\u53ef\u4ee5\u63d0\u4f9b\u5ab2\u7f8e\u771f\u5b9e\u7f16\u8bd1\u5668\u7684\u9519\u8bef\u4f53\u9a8c&#xff0c;\u5728\u4ee3\u7801\u68c0\u67e5\u3001lint \u5de5\u5177\u3001\u8bed\u8a00\u670d\u52a1\u7b49\u573a\u666f\u4e2d\u6781\u5177\u5b9e\u7528\u4ef7\u503c\u3002\u82e5\u60f3\u7ee7\u7eed\u6df1\u5165&#xff0c;\u53ef\u4ee5\u7ed3\u5408 code-actions-sample \u5b66\u4e60\u5982\u4f55\u57fa\u4e8e\u8bca\u65ad\u63d0\u4f9b Code Action \u4fee\u590d&#xff0c;\u6216\u53c2\u8003 lsp-sample \u4e86\u89e3\u5b8c\u6574\u7684\u8bed\u8a00\u670d\u52a1\u5668\u8bca\u65ad\u7ba1\u7ebf\u3002<\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" class=\"gcb-icon-like\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260923182449-6ab41971b287e.svg\" alt=\"\" width=\"16\" height=\"16\" \/> <span class=\"gcb-like-text\">\u8d5e<\/span>  <\/p>\n<p>   <span class=\"gcb-share-text\">\u5206\u4eab<\/span>  <\/p>\n<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u793a\u4f8b\u5de5\u7a0b<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011vscode-extension-samples<\/h3>\n<p class=\"gcb-project-desc\">Sample code illustrating the VS Code extension API.<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/gh_mirrors\/vs\/vscode-extension-samples<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<h4 class=\"gcb-related-title\">\u76f8\u5173\u63a8\u8350<\/h4>\n<ul class=\"gcb-related-list\">\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">\u5982\u4f55\u8ba9TypeScript\u9519\u8bef\u63d0\u793a\u66f4\u53cb\u597d&#xff1a;pretty-ts-errors\u5b8c\u6574\u6307\u5357<\/h5>\n<p class=\"gcb-related-item-desc\">\u5982\u4f55\u8ba9TypeScript\u9519\u8bef\u63d0\u793a\u66f4\u53cb\u597d&#xff1a;pretty ts errors\u5b8c\u6574\u6307\u5357 TypeScript\u662f\u524d\u7aef\u5f00\u53d1\u7684\u5f3a\u5927\u5de5\u5177&#xff0c;\u4f46\u5b83\u7684\u9519\u8bef\u63d0\u793a\u5f80\u5f80\u8fc7\u4e8e\u6280\u672f\u5316&#xff0c;\u8ba9\u65b0<\/p>\n<p>     <span class=\"gcb-tag\">\u5f00\u53d1\u5de5\u5177<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">TypeSpec \u6269\u5c55\u5f00\u53d1\u6307\u5357&#xff1a;\u4e3a\u8bca\u65ad&#xff08;Diagnostic&#xff09;\u7f16\u5199 Code Fix \u4e0e\u81ea\u52a8\u5316\u6d4b\u8bd5<\/h5>\n<p class=\"gcb-related-item-desc\">TypeSpec \u6269\u5c55\u5f00\u53d1\u6307\u5357&#xff1a;\u4e3a\u8bca\u65ad&#xff08;Diagnostic&#xff09;\u7f16\u5199 Code Fix \u4e0e\u81ea\u52a8\u5316\u6d4b\u8bd5 \u5bfc\u8bfb Code fix&#xff08;\u4ee3\u7801\u4fee\u590d&#xff09;\u662f TypeSpec \u7f16\u8bd1<\/p>\n<p>     <span class=\"gcb-tag\">\u7f16\u7a0b\u8bed\u8a00<\/span><br \/>\n     <span class=\"gcb-tag\">\u7f16\u8bd1\u5668<\/span><br \/>\n     <span class=\"gcb-tag\">\u540e\u7aef<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">OK-WW\u9e23\u6f6e\u81ea\u52a8\u5316\u5de5\u5177&#xff1a;\u89e3\u653e\u53cc\u624b\u7684\u7ec8\u6781\u6e38\u620f\u52a9\u624b\u5b8c\u6574\u6307\u5357<\/h5>\n<p class=\"gcb-related-item-desc\">OK WW\u9e23\u6f6e\u81ea\u52a8\u5316\u5de5\u5177&#xff1a;\u89e3\u653e\u53cc\u624b\u7684\u7ec8\u6781\u6e38\u620f\u52a9\u624b\u5b8c\u6574\u6307\u5357 OK WW\u662f\u4e00\u6b3e\u4e13\u4e3a\u300a\u9e23\u6f6e\u300b\u6e38\u620f\u8bbe\u8ba1\u7684\u667a\u80fd\u81ea\u52a8\u5316\u5de5\u5177&#xff0c;\u901a\u8fc7\u5148\u8fdb\u7684\u56fe\u50cf\u8bc6\u522b\u6280\u672f\u6a21\u62df\u73a9\u5bb6\u64cd\u4f5c&#xff0c;\u80fd\u591f\u81ea\u52a8\u5b8c\u6210<\/p>\n<p>     <span class=\"gcb-tag\">GUI \u81ea\u52a8\u5316<\/span><br \/>\n     <span class=\"gcb-tag\">\u8ba1\u7b97\u673a\u89c6\u89c9<\/span><br \/>\n     <span class=\"gcb-tag\">RPA<\/span><br \/>\n     <span class=\"gcb-tag\">\u4eba\u5de5\u667a\u80fd<\/span>\n      <\/li>\n<\/ul>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0a\u4e00\u7bc7&#xff1a;<\/span><br \/>\n  \u4f7f\u7528 Rube MCP \u81ea\u52a8\u5316 Timecamp \u5de5\u65f6\u8ffd\u8e2a&#xff1a;awesome-codex-skills \u7684 timecamp-automation \u6280\u80fd\u5b9e\u6218\u6307\u5357 <\/p>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0b\u4e00\u7bc7&#xff1a;<\/span><br \/>\n  caj2pdf&#xff1a;\u7ec8\u6781\u514d\u8d39\u65b9\u6848\u89e3\u51b3CAJ\u8f6cPDF\u96be\u9898 <\/p>\n<p>\u521b\u4f5c\u58f0\u660e\uff1a\u672c\u6587\u90e8\u5206\u5185\u5bb9\u7531AI\u8f85\u52a9\u751f\u6210\uff08AIGC\uff09\uff0c\u4ec5\u4f9b\u53c2\u8003<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u793a\u4f8b\u5de5\u7a0b \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011vscode-extension-samples Sample code illustrating the VS Code extension API. \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/gh_mirrors\/vs\/vscode-extension-samples \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d  \u5bfc\u8bfb<br \/>\n\u672c\u6587\u4ee5 vscode-extension-samples \u4ed3\u5e93\u4e2d\u7684 diagnostic-related-informatio<\/p>\n","protected":false},"author":2,"featured_media":109394,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-109396","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f7f\u7528 Diagnostic Related Information \u589e\u5f3a VS Code \u6269\u5c55\u8bca\u65ad\u4fe1\u606f\uff1adiagnostic-related-information-sample \u6df1\u5ea6\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/109396.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528 Diagnostic Related Information \u589e\u5f3a VS Code \u6269\u5c55\u8bca\u65ad\u4fe1\u606f\uff1adiagnostic-related-information-sample \u6df1\u5ea6\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u793a\u4f8b\u5de5\u7a0b \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011vscode-extension-samples Sample code illustrating the VS Code extension API. \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/gh_mirrors\/vs\/vscode-extension-samples \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d \u5bfc\u8bfb \u672c\u6587\u4ee5 vscode-extension-samples \u4ed3\u5e93\u4e2d\u7684 diagnostic-related-informatio\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/109396.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-23T18:24:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260923182449-6ab4197118273.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/109396.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/109396.html\",\"name\":\"\u4f7f\u7528 Diagnostic Related Information \u589e\u5f3a VS Code \u6269\u5c55\u8bca\u65ad\u4fe1\u606f\uff1adiagnostic-related-information-sample \u6df1\u5ea6\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-23T18:24:50+00:00\",\"dateModified\":\"2026-09-23T18:24:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/109396.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/109396.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/109396.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528 Diagnostic Related Information \u589e\u5f3a VS Code \u6269\u5c55\u8bca\u65ad\u4fe1\u606f\uff1adiagnostic-related-information-sample \u6df1\u5ea6\u89e3\u6790\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528 Diagnostic Related Information \u589e\u5f3a VS Code \u6269\u5c55\u8bca\u65ad\u4fe1\u606f\uff1adiagnostic-related-information-sample \u6df1\u5ea6\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/109396.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528 Diagnostic Related Information \u589e\u5f3a VS Code \u6269\u5c55\u8bca\u65ad\u4fe1\u606f\uff1adiagnostic-related-information-sample \u6df1\u5ea6\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u793a\u4f8b\u5de5\u7a0b \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011vscode-extension-samples Sample code illustrating the VS Code extension API. \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/gh_mirrors\/vs\/vscode-extension-samples \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d \u5bfc\u8bfb \u672c\u6587\u4ee5 vscode-extension-samples \u4ed3\u5e93\u4e2d\u7684 diagnostic-related-informatio","og_url":"https:\/\/www.wsisp.com\/helps\/109396.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-23T18:24:50+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260923182449-6ab4197118273.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/109396.html","url":"https:\/\/www.wsisp.com\/helps\/109396.html","name":"\u4f7f\u7528 Diagnostic Related Information \u589e\u5f3a VS Code \u6269\u5c55\u8bca\u65ad\u4fe1\u606f\uff1adiagnostic-related-information-sample \u6df1\u5ea6\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-23T18:24:50+00:00","dateModified":"2026-09-23T18:24:50+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/109396.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/109396.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/109396.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528 Diagnostic Related Information \u589e\u5f3a VS Code \u6269\u5c55\u8bca\u65ad\u4fe1\u606f\uff1adiagnostic-related-information-sample \u6df1\u5ea6\u89e3\u6790"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/109396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=109396"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/109396\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/109394"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=109396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=109396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=109396"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=109396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}