@typespec/compiler 1.5.0-dev.10 → 1.5.0-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.js +2 -2
- package/dist/src/core/compiler-code-fixes/suppress.codefix.d.ts +2 -2
- package/dist/src/core/compiler-code-fixes/suppress.codefix.d.ts.map +1 -1
- package/dist/src/core/compiler-code-fixes/suppress.codefix.js +2 -2
- package/dist/src/core/compiler-code-fixes/suppress.codefix.js.map +1 -1
- package/package.json +1 -1
package/dist/manifest.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { DiagnosticTarget } from "../types.js";
|
|
2
|
-
export declare function createSuppressCodeFix(diagnosticTarget: DiagnosticTarget, warningCode: string):
|
|
1
|
+
import type { CodeFix, DiagnosticTarget } from "../types.js";
|
|
2
|
+
export declare function createSuppressCodeFix(diagnosticTarget: DiagnosticTarget, warningCode: string, suppressionMessage?: string): CodeFix;
|
|
3
3
|
//# sourceMappingURL=suppress.codefix.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suppress.codefix.d.ts","sourceRoot":"","sources":["../../../../src/core/compiler-code-fixes/suppress.codefix.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"suppress.codefix.d.ts","sourceRoot":"","sources":["../../../../src/core/compiler-code-fixes/suppress.codefix.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAkB,MAAM,aAAa,CAAC;AAE7E,wBAAgB,qBAAqB,CACnC,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,MAAM,EACnB,kBAAkB,GAAE,MAAW,GAC9B,OAAO,CAcT"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isWhiteSpace } from "../charcode.js";
|
|
2
2
|
import { defineCodeFix, getSourceLocation } from "../diagnostics.js";
|
|
3
|
-
export function createSuppressCodeFix(diagnosticTarget, warningCode) {
|
|
3
|
+
export function createSuppressCodeFix(diagnosticTarget, warningCode, suppressionMessage = "") {
|
|
4
4
|
return defineCodeFix({
|
|
5
5
|
id: "suppress",
|
|
6
6
|
label: `Suppress warning: "${warningCode}"`,
|
|
@@ -8,7 +8,7 @@ export function createSuppressCodeFix(diagnosticTarget, warningCode) {
|
|
|
8
8
|
const location = getSourceLocation(diagnosticTarget);
|
|
9
9
|
const { lineStart, indent } = findLineStartAndIndent(location);
|
|
10
10
|
const updatedLocation = { ...location, pos: lineStart };
|
|
11
|
-
return context.prependText(updatedLocation, `${indent}#suppress "${warningCode}" ""\n`);
|
|
11
|
+
return context.prependText(updatedLocation, `${indent}#suppress "${warningCode}" "${suppressionMessage}"\n`);
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suppress.codefix.js","sourceRoot":"","sources":["../../../../src/core/compiler-code-fixes/suppress.codefix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGrE,MAAM,UAAU,qBAAqB,
|
|
1
|
+
{"version":3,"file":"suppress.codefix.js","sourceRoot":"","sources":["../../../../src/core/compiler-code-fixes/suppress.codefix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGrE,MAAM,UAAU,qBAAqB,CACnC,gBAAkC,EAClC,WAAmB,EACnB,qBAA6B,EAAE;IAE/B,OAAO,aAAa,CAAC;QACnB,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,sBAAsB,WAAW,GAAG;QAC3C,GAAG,EAAE,CAAC,OA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