Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix encoding management #413

Merged
merged 10 commits into from
Apr 24, 2024
2 changes: 2 additions & 0 deletions .ncurc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@types/vscode",
"@types/vscode-marked",
"@types/vscode-semver",
"@vscode/iconv-lite-umd",
"@vscode/proxy-agent",
"@vscode/ripgrep",
"@vscode/spdlog",
Expand All @@ -22,6 +23,7 @@
"@xterm/headless",
"@xterm/xterm",
"cookie",
"jschardet",
"kerberos",
"node-pty",
"vscode-marked",
Expand Down
325 changes: 161 additions & 164 deletions demo/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
"@codingame/monaco-vscode-workspace-trust-service-override": "file:../dist/service-override-workspace-trust",
"@codingame/monaco-vscode-xml-default-extension": "file:../dist/default-extension-xml",
"@codingame/monaco-vscode-yaml-default-extension": "file:../dist/default-extension-yaml",
"@codingame/monaco-vscode-view-common-service-override": "file:../dist/service-override-view-common",
"ansi-colors": "^4.1.3",
"dockerode": "^4.0.2",
"express": "^4.19.2",
Expand Down
104 changes: 52 additions & 52 deletions demo/src/setup.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,82 +92,82 @@ if (useHtmlFileSystemProvider) {
const fileSystemProvider = new RegisteredFileSystemProvider(false)

fileSystemProvider.registerFile(new RegisteredMemoryFile(vscode.Uri.file('/tmp/test.js'), `// import anotherfile
let variable = 1
function inc () {
variable++
}
let variable = 1
function inc () {
variable++
}

while (variable < 5000) {
inc()
console.log('Hello world', variable);
}`
while (variable < 5000) {
inc()
console.log('Hello world', variable);
}`
))

fileSystemProvider.registerFile(new RegisteredReadOnlyFile(vscode.Uri.file('/tmp/test_readonly.js'), async () => 'This is a readonly static file'))

fileSystemProvider.registerFile(new RegisteredMemoryFile(vscode.Uri.file('/tmp/jsconfig.json'), `{
"compilerOptions": {
"target": "es2020",
"module": "esnext",
"lib": [
"es2021",
"DOM"
]
}
}`
"compilerOptions": {
"target": "es2020",
"module": "esnext",
"lib": [
"es2021",
"DOM"
]
}
}`
))

fileSystemProvider.registerFile(new RegisteredMemoryFile(vscode.Uri.file('/tmp/index.html'), `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>monaco-vscode-api demo</title>
<link rel="stylesheet" href="test.css">
</head>
<body>
<style type="text/css">
h1 {
color: DeepSkyBlue;
}
</style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>monaco-vscode-api demo</title>
<link rel="stylesheet" href="test.css">
</head>
<body>
<style type="text/css">
h1 {
color: DeepSkyBlue;
}
</style>

<h1>Hello, world!</h1>
</body>
</html>`
<h1>Hello, world!</h1>
</body>
</html>`
))

fileSystemProvider.registerFile(new RegisteredMemoryFile(vscode.Uri.file('/tmp/test.md'), `
***Hello World***
***Hello World***

Math block:
$$
\\displaystyle
\\left( \\sum_{k=1}^n a_k b_k \\right)^2
\\leq
\\left( \\sum_{k=1}^n a_k^2 \\right)
\\left( \\sum_{k=1}^n b_k^2 \\right)
$$
Math block:
$$
\\displaystyle
\\left( \\sum_{k=1}^n a_k b_k \\right)^2
\\leq
\\left( \\sum_{k=1}^n a_k^2 \\right)
\\left( \\sum_{k=1}^n b_k^2 \\right)
$$

# Easy Math
# Easy Math

2 + 2 = 4 // this test will pass
2 + 2 = 5 // this test will fail
2 + 2 = 4 // this test will pass
2 + 2 = 5 // this test will fail

# Harder Math
# Harder Math

230230 + 5819123 = 6049353
`
230230 + 5819123 = 6049353
`
))

fileSystemProvider.registerFile(new RegisteredMemoryFile(vscode.Uri.file('/tmp/test.customeditor'), `
Custom Editor!`
Custom Editor!`
))

fileSystemProvider.registerFile(new RegisteredMemoryFile(vscode.Uri.file('/tmp/test.css'), `
h1 {
color: DeepSkyBlue;
}`
h1 {
color: DeepSkyBlue;
}`
))

// Use a workspace file to be able to add another folder later (for the "Attach filesystem" button)
Expand Down
8 changes: 6 additions & 2 deletions demo/src/user/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
"editor.semanticHighlighting.enabled": true,
"editor.bracketPairColorization.enabled": false,
"editor.fontSize": 12,
"audioCues.lineHasError": "on",
"audioCues.onDebugBreak": "on",
"accessibility.signals.lineHasError": {
"sound": "on"
},
"accessibility.signals.onDebugBreak": {
"sound": "on"
},
"files.autoSave": "off",
"debug.toolBarLocation": "docked",
"editor.experimental.asyncTokenization": true,
Expand Down
14 changes: 6 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"@types/yauzl": "^2.10.3",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"@vscode/iconv-lite-umd": "^0.7.0",
"@web/rollup-plugin-import-meta-assets": "^2.2.1",
"change-package-name": "^1.0.5",
"eslint": "^8.57.0",
Expand All @@ -80,7 +79,6 @@
"graceful-fs": "^4.2.11",
"is-builtin-module": "^3.2.1",
"js-cleanup": "^1.2.0",
"jschardet": "^3.1.2",
"package-json": "^10.0.0",
"param-case": "^3.0.4",
"pascal-case": "^3.1.2",
Expand Down Expand Up @@ -130,7 +128,9 @@
"vscode-regexpp": "^3.1.0",
"vscode-textmate": "9.0.0",
"yauzl": "^3.0.0",
"yazl": "^2.4.3"
"yazl": "^2.4.3",
"@vscode/iconv-lite-umd": "0.7.0",
"jschardet": "3.0.0"
},
"overrides": {
"typescript": "$typescript",
Expand Down
Loading