Skip to content

Commit b4cb6a9

Browse files
committed
Remove label from new routine stub
1 parent b9d1ebb commit b4cb6a9

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

src/providers/FileSystemProvider/FileSystemProvider.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
openLowCodeEditors,
1919
compileErrorMsg,
2020
} from "../../utils";
21-
import { FILESYSTEM_READONLY_SCHEMA, FILESYSTEM_SCHEMA, intLangId, macLangId } from "../../extension";
21+
import { FILESYSTEM_READONLY_SCHEMA, FILESYSTEM_SCHEMA } from "../../extension";
2222
import { addIsfsFileToProject, modifyProject } from "../../commands/project";
2323
import { DocumentContentProvider } from "../DocumentContentProvider";
2424
import { Document, UserAction } from "../../api/atelier";
@@ -124,18 +124,11 @@ export function generateFileContent(
124124
sourceLines.shift();
125125
const routineName = fileName.split(".").slice(0, -1).join(".");
126126
const routineType = fileExt != "mac" ? `[Type=${fileExt.toUpperCase()}]` : "";
127-
if (sourceLines.length === 0 && fileExt !== "inc") {
128-
const languageId = fileExt === "mac" ? macLangId : intLangId;
129-
130-
// Labels cannot contain dots
131-
const firstLabel = routineName.replaceAll(".", "");
132-
133-
// Be smart about whether to use a Tab or a space between label and comment.
134-
// Doing this will help autodetect to do the right thing.
135-
const lineStart = vscode.workspace.getConfiguration("editor", { languageId, uri }).get("insertSpaces")
136-
? " "
137-
: "\t";
138-
sourceLines.push(`${firstLabel}${lineStart};`);
127+
if (!sourceLines.length) {
128+
// Add a macro comment line
129+
if (fileExt != "int") sourceLines.push("#;");
130+
// Add a trailing newline
131+
sourceLines.push("");
139132
}
140133
return {
141134
content: [`ROUTINE ${routineName} ${routineType}`, ...sourceLines],

0 commit comments

Comments
 (0)