Skip to content

Writing-a-Language-Service-Plugin recommends local testing which does not appear possible anymore #47149

@MarcCelani-at

Description

@MarcCelani-at

Bug Report

In the Writing-a-Language-Service-Plugin doc, it is recommended that you test locally:

To locally test your plugin, set up a sample project and give it the path to your plugin in the tsconfig.json file. For example:

your_plugin/index.ts
your_plugin/index.js (compiled by tsc)
sample_project/tsconfig.json
where sample_project/tsconfig.json contains

{
"compilerOptions": {
"plugins": [{
"name": "../your_plugin",
}]
}
}

When I attempted to do this, my plugin does not load. I get this error:

Info 24   [11:40:45.666] Enabling plugin ./ts_lang_datadog_reporter from candidate paths: <redacted>
Info 25   [11:40:45.666] Skipped loading plugin ./ts_lang_datadog_reporter because only package name is allowed plugin name

It appears that the option to load a plugin locally was disabled in #42713 but there was no follow up to update the documentation. Is this a bug on my side, or is the documentation out of date?

🔎 Search Terms

Writing-a-Language-Service-Plugin language service plugin

🕗 Version & Regression Information

  • I was unable to test this on prior versions because going backwards to old typescript versions in my project is extremely challenging

💻 Code

cat tsconfig.base.json
...
        "plugins": [
            {
                "name": "./ts_lang_datadog_reporter"
            }
        ]
...


ls ts_lang_datadog_reporter
ts_lang_datadog_reporter/tsconfig.json
ts_lang_datadog_reporter/index.js
ts_lang_datadog_reporter/index.ts
ts_lang_datadog_reporter/logger.js
ts_lang_datadog_reporter/logger.ts
ts_lang_datadog_reporter/plugin.js
ts_lang_datadog_reporter/plugin.ts

🙁 Actual behavior

Following the example in the documentation but cannot load a plugin locally

🙂 Expected behavior

Documentation reflects reality

Metadata

Metadata

Assignees

Labels

DocsThe issue relates to how you learn TypeScript

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions