Skip to content

Commit e4a5f0e

Browse files
committed
fix: code review
1 parent 4048d86 commit e4a5f0e

File tree

7 files changed

+20
-16
lines changed

7 files changed

+20
-16
lines changed

extensions/vscode/scripts/build.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async function main() {
5757
await buildMetadataSchema();
5858

5959
if (production) {
60-
// rename name in package json to match extension name on store:
60+
// rename name in `package.json` to match extension name on store
6161
const pkgJSON = JSON.parse(fs.readFileSync('./package.json', { encoding: 'utf8' }));
6262

6363
pkgJSON.name = 'tutorialkit';

extensions/vscode/src/extension.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export async function activate(context: vscode.ExtensionContext) {
1818
const serverModule = vscode.Uri.joinPath(context.extensionUri, 'dist', 'server.js');
1919
const runOptions = { execArgv: <string[]>[] };
2020
const debugOptions = { execArgv: ['--nolazy', '--inspect=' + 6009] };
21+
2122
const serverOptions: lsp.ServerOptions = {
2223
run: {
2324
module: serverModule.fsPath,
@@ -30,10 +31,12 @@ export async function activate(context: vscode.ExtensionContext) {
3031
options: debugOptions,
3132
},
3233
};
34+
3335
const clientOptions: lsp.LanguageClientOptions = {
3436
documentSelector: [{ language: 'markdown' }, { language: 'mdx' }],
3537
initializationOptions: {},
3638
};
39+
3740
client = new lsp.LanguageClient('tutorialkit-language-server', 'TutorialKit', serverOptions, clientOptions);
3841

3942
await client.start();

extensions/vscode/src/language-server/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ connection.onInitialize((params) => {
2323
isKubernetes: false,
2424
schemas: [
2525
{
26-
uri: 'https://tutorialkit.dev/reference/configuration/',
26+
uri: 'https://tutorialkit.dev/reference/configuration',
2727
schema,
2828
fileMatch: [
2929
'**/*',

extensions/vscode/src/language-server/languagePlugin.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { CodeMapping, type LanguagePlugin, type VirtualCode } from '@volar/langu
22
import type * as ts from 'typescript';
33
import type { URI } from 'vscode-uri';
44

5-
export const frontmatterPlugin = (debug: (message: string) => void) =>
6-
({
5+
export function frontmatterPlugin(debug: (message: string) => void): LanguagePlugin<URI> {
6+
return {
77
getLanguageId(uri) {
88
debug('URI: ' + uri.path);
99

@@ -24,7 +24,8 @@ export const frontmatterPlugin = (debug: (message: string) => void) =>
2424

2525
return undefined;
2626
},
27-
}) satisfies LanguagePlugin<URI>;
27+
};
28+
}
2829

2930
export class FrontMatterVirtualCode implements VirtualCode {
3031
id = 'root';

packages/types/src/schemas/chapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const chapterSchema = baseSchema.extend({
77
.array(z.string())
88
.optional()
99
.describe(
10-
'The list of lessons in this chapter. The order in this array defines the order of the lessons. If not specified a folder-based numbering system is used instead.',
10+
'The list of lessons in this chapter. The order of the array defines the order of the lessons. If not specified a folder-based numbering system is used instead.',
1111
),
1212
});
1313

packages/types/src/schemas/common.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const panelTypeSchema = z
5757
const allowRedirectsSchema = z
5858
.boolean()
5959
.optional()
60-
.describe('`true` if you want to enable output redirects in the terminal, disabled by default.');
60+
.describe("Set to `true` if you want to enable output redirects in the terminal. It's disabled by default.");
6161

6262
const allowCommandsSchema = z
6363
.array(z.string())
@@ -173,7 +173,7 @@ export const webcontainerSchema = commandsSchema.extend({
173173
.string()
174174
.optional()
175175
.describe(
176-
'Specified which folder from the src/templates/ directory should be used as the basis for the code. See the Code templates guide for a detailed explainer.',
176+
'Specified which folder from the `src/templates/` directory should be used as the basis for the code. See the "Code templates" guide for a detailed explainer.',
177177
),
178178
terminal: terminalSchema
179179
.optional()
@@ -210,7 +210,7 @@ export const webcontainerSchema = commandsSchema.extend({
210210
])
211211
.optional()
212212
.describe(
213-
'Display a link in lesson for editing the page content. The value is a URL pattern where ${path} is replaced with the lesson’s location relative to src/content/tutorial.',
213+
'Display a link in lesson for editing the page content. The value is a URL pattern where `${path}` is replaced with the lesson’s location relative to `src/content/tutorial`.',
214214
),
215215
});
216216

@@ -220,7 +220,7 @@ export const baseSchema = webcontainerSchema.extend({
220220
.string()
221221
.optional()
222222
.describe(
223-
'Customize the URL segment of this part / chapter or lesson. The full URL path is /:partSlug/:chapterSlug/:lessonSlug.',
223+
'Customize the URL segment of this part, chapter or lesson. The full URL path is `/:partSlug/:chapterSlug/:lessonSlug`.',
224224
),
225225
});
226226

packages/types/src/schemas/i18n.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,25 @@ export const i18nSchema = z.object({
5050
prepareEnvironmentTitleText: z.string().optional().describe('Text shown on top of the steps section.'),
5151

5252
/**
53-
* Text shown for the toggle terminal button.
53+
* Text for the toggle terminal button.
5454
*
5555
* @default 'Toggle Terminal'
5656
*/
57-
toggleTerminalButtonText: z.string().optional().describe('Text shown for the toggle terminal button.'),
57+
toggleTerminalButtonText: z.string().optional().describe('Text for the toggle terminal button.'),
5858

5959
/**
60-
* Text shown for the solve button.
60+
* Text for the solve button.
6161
*
6262
* @default 'Solve'
6363
*/
64-
solveButtonText: z.string().optional().describe('Text shown for the solve button.'),
64+
solveButtonText: z.string().optional().describe('Text for the solve button.'),
6565

6666
/**
67-
* Text shown for the reset button.
67+
* Text for the reset button.
6868
*
6969
* @default 'Reset'
7070
*/
71-
resetButtonText: z.string().optional().describe('Text shown for the reset button.'),
71+
resetButtonText: z.string().optional().describe('Text for the reset button.'),
7272
});
7373

7474
export type I18nSchema = z.infer<typeof i18nSchema>;

0 commit comments

Comments
 (0)