Skip to content

refactor(monaco): replace activateAutomaticTypeAcquisition with createNpmFileSystem#218

Merged
johnsoncodehk merged 2 commits intomasterfrom
remove-activateAutomaticTypeAcquisition
Jun 30, 2024
Merged

refactor(monaco): replace activateAutomaticTypeAcquisition with createNpmFileSystem#218
johnsoncodehk merged 2 commits intomasterfrom
remove-activateAutomaticTypeAcquisition

Conversation

@johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented Jun 30, 2024

The activateAutomaticTypeAcquisition function has been removed, createNpmFileSystem should now be used instead in v2.4.

Example

import { createNpmFileSystem } from '@volar/jsdelivr';

const env: LanguageServiceEnvironment = {
  workspaceFolders: [URI.file('/')],
  locale,
  fs: createNpmFileSystem(
    uri => {
      if (uri.scheme === 'file') {
        if (uri.path === '/node_modules') {
          return ''
        }
        else if (uri.path.startsWith('/node_modules/')) {
          return uri.path.substring('/node_modules/'.length)
        }
      }
    }
  )
};

@johnsoncodehk johnsoncodehk merged commit 4a40317 into master Jun 30, 2024
@johnsoncodehk johnsoncodehk deleted the remove-activateAutomaticTypeAcquisition branch June 30, 2024 22:12
@johnsoncodehk johnsoncodehk changed the title refactor(monaco): replace activateAutomaticTypeAcquisition refactor(monaco): replace activateAutomaticTypeAcquisition with createNpmFileSystem Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant