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

When I tried to write the CSS style, I lacked the smart advance prompt. The console reported the following error #5593

Closed
yunliang-ding opened this issue Jun 27, 2019 · 8 comments
Labels
🤔 needs more info issues that require more info from the author

Comments

@yunliang-ding
Copy link

Dependency packages are latest

When I tried to write the CSS style, I lacked the smart advance prompt. The console reported the following error

Uncaught Error: Cannot read property 'InsertAsSnippet' of undefined
TypeError: Cannot read property 'InsertAsSnippet' of undefined
at cssMode.js:7
at Array.map ()
at cssMode.js:7
at Object.g [as _notify] (editor.main.js:141)
at Object.enter (editor.main.js:145)
at n.Class.derive._creator._run (editor.main.js:146)
at n.Class.derive._creator._completed (editor.main.js:146)
at Object.g [as _notify] (editor.main.js:141)
at Object.enter (editor.main.js:145)
at n.Class.derive._oncancel._run (editor.main.js:146)
at editor.main.js:158

@kittaakos kittaakos added the 🤔 needs more info issues that require more info from the author label Jun 27, 2019
@kittaakos
Copy link
Contributor

@yunliang-ding, what exactly did you do? Did this happen in a CSS editor?

@yunliang-ding
Copy link
Author

@yunliang-ding, what exactly did you do? Did this happen in a CSS editor?

Yes, in the Monaco editor, the grammar is CSS

@kittaakos
Copy link
Contributor

Can you share your CSS file and the steps you did? I opened a couple of CSS files, did some editing but wasn't able to reproduce this defect.

@yunliang-ding
Copy link
Author

yunliang-ding commented Jun 27, 2019

Can you share your CSS file and the steps you did? I opened a couple of CSS files, did some editing but wasn't able to reproduce this defect.

package.json

{
  "private": true,
  "dependencies": {
    "typescript": "latest",
    "@theia/typescript": "latest",
    "@theia/navigator": "latest",
    "@theia/terminal": "latest",
    "@theia/outline-view": "latest",
    "@theia/preferences": "latest",
    "@theia/messages": "latest",
    "@theia/git": "latest",
    "@theia/file-search": "latest",
    "@theia/markers": "latest",
    "@theia/preview": "latest",
    "@theia/callhierarchy": "latest",
    "@theia/merge-conflicts": "latest",
    "@theia/search-in-workspace": "latest",
    "@theia/json": "latest",
    "@theia/textmate-grammars": "latest"
  },
  "devDependencies": {
    "@theia/cli": "latest"
  }
}

step 1: yarn
step 2:yarn theia build
step 3:yarn theia start

Then in the editor, my CSS file has no grammar prompt, and the console will report an error.
Is it because I'm less dependent?

@vince-fugnitto
Copy link
Member

@yunliang-ding I tried your example package.json and got the same error when editing a css file :(

@kittaakos
Copy link
Contributor

Must be some version mismatch issue. As a quick workaround, you can copy the yarn.lock file from the Theia repository into your application root, next to the package.json and run yarn again. It should work. I have tried it.

@blueken
Copy link

blueken commented Jul 4, 2019

I think It's [email protected] caused css highlight failure

Here is my solution:

Step1: downgrade monaco-css
yarn add [email protected]

Step2: build theia again
yarn theia build

Step3: start theia
yarn theia start

Then you 'll see css highlight works :P

try it @yunliang-ding @vince-fugnitto

Must be some version mismatch issue. As a quick workaround, you can copy the yarn.lock file from the Theia repository into your application root, next to the package.json and run yarn again. It should work. I have tried it.

@vince-fugnitto
Copy link
Member

I confirmed it is no longer an issue when attempting to edit css files.

In addition, the packages present in #5593 (comment) are no longer valid since @theia/json and @theia/textmate-grammars are deprecated. Support for languages such as css are provided by vscode extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 needs more info issues that require more info from the author
Projects
None yet
Development

No branches or pull requests

4 participants