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

Remove winston #17

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 1 addition & 68 deletions server/package-lock.json

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

3 changes: 1 addition & 2 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"find": "^0.2.7",
"vscode-languageserver": "^8.1.0",
"vscode-languageserver-textdocument": "^1.0.8",
"web-tree-sitter": "^0.20.8",
"winston": "^2.4.4"
"web-tree-sitter": "^0.20.8"
},
"scripts": {
"installServer": "installServerIntoExtension ../client ./package.json ./tsconfig.json"
Expand Down
14 changes: 7 additions & 7 deletions server/src/embedded-languages/documents-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { randomUUID } from 'crypto'
import path from 'path'
import fs from 'fs'

import logger from 'winston'
import { logger } from '../lib/src/utils/OutputLogger'

import { type EmbeddedLanguageDocInfos, type EmbeddedLanguageType } from '../lib/src/types/embedded-languages'
import { type EmbeddedLanguageDoc } from './utils'
Expand Down Expand Up @@ -45,7 +45,7 @@ export default class EmbeddedLanguageDocsManager {
const newPathToEmbeddedLanguageDocsFolder = path.join(newStoragePath, EMBEDDED_DOCUMENTS_FOLDER)
fs.mkdir(newPathToEmbeddedLanguageDocsFolder, { recursive: true }, (err) => {
if (err !== null) {
logger.error('Failed to create embedded language documents folder:', err)
logger.error(`Failed to create embedded language documents folder: ${JSON.stringify(err)}`)
}
resolve()
})
Expand All @@ -58,7 +58,7 @@ export default class EmbeddedLanguageDocsManager {
const oldPathToEmbeddedLanguageDocsFolder = path.join(this._storagePath, EMBEDDED_DOCUMENTS_FOLDER)
fs.rmdir(oldPathToEmbeddedLanguageDocsFolder, { recursive: true }, (err) => {
if (err !== null) {
logger.error('Failed to remove embedded language documents folder:', err)
logger.error(`Failed to remove embedded language documents folder: ${JSON.stringify(err)}`)
}
resolve()
})
Expand Down Expand Up @@ -102,7 +102,7 @@ export default class EmbeddedLanguageDocsManager {
async saveEmbeddedLanguageDoc (
embeddedLanguageDoc: EmbeddedLanguageDoc
): Promise<void> {
logger.debug(`Save embedded document (${embeddedLanguageDoc.language}) for`, embeddedLanguageDoc.originalUri)
logger.debug(`Save embedded document (${embeddedLanguageDoc.language}) for ${embeddedLanguageDoc.originalUri}`)
const pathToEmbeddedLanguageDoc = this.getPathToEmbeddedLanguageDoc(embeddedLanguageDoc)
if (pathToEmbeddedLanguageDoc === undefined) {
return
Expand All @@ -118,12 +118,12 @@ export default class EmbeddedLanguageDocsManager {
}
this.registerEmbeddedLanguageDocInfos(embeddedLanguageDoc.originalUri, embeddedLanguageDocInfos)
}).catch((err) => {
logger.error('Failed to create embedded document:', err)
logger.error(`Failed to create embedded document: ${err}`)
})
}

async deleteEmbeddedLanguageDocs (originalUriString: string): Promise<void> {
logger.debug('Delete embedded documents for', originalUriString)
logger.debug(`Delete embedded documents for ${originalUriString}`)
const embeddedLanguageDocs = this.embeddedLanguageDocsInfos.get(originalUriString) ?? {}
await Promise.all(Object.values(embeddedLanguageDocs).map(async ({ uri }) => {
await new Promise<void>((resolve, reject) => {
Expand All @@ -135,7 +135,7 @@ export default class EmbeddedLanguageDocsManager {
})).then(() => {
this.embeddedLanguageDocsInfos.delete(originalUriString)
}).catch((err) => {
logger.error('Failed to delete embedded document:', err)
logger.error(`Failed to delete embedded document: ${err}`)
})
}

Expand Down
Loading