question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't override default extensions option

See original GitHub issue

Clear and concise description of the problem

Can’t override default extensions option

Suggested solution

Replace basicSetup with minimalSetup or set the default extensions to []

https://github.com/surmon-china/vue-codemirror/blob/222b5c685fc006a8ccd5c834f588589c7f58edc3/src/config.ts#L2

Alternative

No response

Additional context

No response

Validations

  • Check that there isn’t already an issue that request the same feature to avoid creating a duplicate.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kabalagecommented, Oct 25, 2022

But what if I don’t want to install it globally? I don’t even want to import codemirror on page load, only when it’s needed.

Solution 1: Add a useBasicSetup (or similarily named) prop to the component with default value of true to not break existing code. Handling reactivity for this would cause complications. But personally I would not mind if this prop wasn’t handled reactively.

Solution 2: Expose the config injection symbol to be able to provide the “global” config in wrapper components. It’s uglier, but less expected to be reactive this way.

0reactions
surmon-chinacommented, Nov 1, 2022

Hi @kabalage

Sorry for the late reply.

It’s true that creating a redundant concept is not elegant and can be ambiguous, but I need to confirm the difference between props.extensions and basicExtensions, which are consumed by passing EditorState.create({ extensions }) which may be contradictory to vue’s responsiveness, so it is not certain that basicExtensions is a concept that can be ignored.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can't change the default program to open an extension in ...
Solution: Found the below reg key [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.eml] Deleted the .eml key. Double clicked the .
Read more >
Declarations from extensions cannot be overridden yet in Swift 4
But in the above scenario, I am not overriding the method isValid() in extension. It is overridden in the SampleCell class definition itself....
Read more >
Chrome Extensions: Overriding Chrome pages
Note: A single extension can override only one page. For example, an extension can't override both the Bookmark Manager and History pages.
Read more >
Allow `override` of `open` methods in & from extensions in ...
I use extension a lot to clarify my code, separating the main declaration of a class/struct and its properties from the methods I...
Read more >
[snippets] Cannot override/disable snippets defined ... - GitHub
One of the Go Extension users talks about the ability to override/disable the snippets defined in the Go extension. vscode-go/#385.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found