-
Notifications
You must be signed in to change notification settings - Fork 274
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
add web support #539
add web support #539
Conversation
src/webworker/yamlServerMain.ts
Outdated
import { YAMLServerInit } from '../yamlServerInit'; | ||
import { SettingsState } from '../yamlSettings'; | ||
|
||
declare const self: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you fix this warning?
test/schemaRequestHandler.test.ts
Outdated
}); | ||
|
||
afterEach(() => { | ||
sandbox.restore(); | ||
}); | ||
it('Should care Win URI', async () => { | ||
const connection = <Connection>{}; | ||
const resultPromise = schemaRequestHandler(connection, 'c:\\some\\window\\path\\scheme.json', [], URI.parse(''), false); | ||
const resultPromise = schemaRequestHandler(connection, 'c:\\some\\window\\path\\scheme.json', [], URI.parse(''), false, testFileSystem); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this prettier error?
test/schemaRequestHandler.test.ts
Outdated
const result = await resultPromise; | ||
expect(result).to.be.equal('{some: "json"}'); | ||
}); | ||
|
||
it('should handle not valid Windows path', async () => { | ||
const connection = <Connection>{}; | ||
const resultPromise = schemaRequestHandler(connection, 'A:/some/window/path/scheme.json', [], URI.parse(''), false); | ||
const resultPromise = schemaRequestHandler(connection, 'A:/some/window/path/scheme.json', [], URI.parse(''), false, testFileSystem); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this
test/utils/testHelper.ts
Outdated
@@ -46,6 +47,8 @@ export function setupSchemaIDTextDocument(content: string, customSchemaID?: stri | |||
} | |||
} | |||
|
|||
export const testFileSystem = { readFile: (fsPath: string) => fs.readFile(fsPath).then(c => c.toString())}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this
Adds a new server main that can run in a webworker.
See redhat-developer/vscode-yaml#594 for the details