Skip to content

[CLOSED] Integrate latest CodeMirror for sprint 36 #5710

@core-ai-bot

Description

@core-ai-bot

Issue by njx
Wednesday Dec 18, 2013 at 23:56 GMT
Originally opened as adobe/brackets#6268


Update: Removed "[discussion only]" tag since we think we've addressed the issues and could merge this.

In the latest CM (as of codemirror/codemirror5@d13582f), the CSS mode has been refactored substantially. The good news is that LESS is now supported by CSS mode, meaning that we can much more easily make basic code hinting work for LESS files (similar to what we've already done for SCSS files). The less good news is that the internals of the mode have changed significantly. In particular:

  • There's no longer a stack member on the state object, but instead a context member which seems to fulfill the same role (using a linked list instead of a stack).
  • Some of the token types appear to have changed (specifically, propertyValue now seems to be prop).

This PR contains a quick attempt to make the existing CSS code hinting work properly with the changes to CSS mode. It also hooks up LESS files to the CSS mode (instead of the old LESS mode) and attempts to turn on code hinting in those files.

With these changes, it looks like almost all the existing CSS code hinting unit tests pass, except for one in CSS Context Info. However, I haven't done much manual testing beyond verifying that basic property and value hints seem to work in CSS and LESS files. Also, this was based on only a very cursory understanding of the existing CSSUtils code and of the changes to the CM CSS mode, so it's quite likely that we need to do more work and testing to make sure everything is working properly.

@RaymondLim - would you mind taking a look at the code changes and seeing what you think? I'm wondering if we need to add a story for this (to ensure we get adequate testing, etc.), which might mean pushing it to the next sprint.

Additionally, there were a number of other smaller changes since our last CM merge that are probably worth testing around. From looking at the commit log, these are the areas we'd want to do some sanity testing around:

  • Inline editor line hiding (esp at beginning/end of doc) - make fix first
  • LESS - using CSS mode now! - include that and test
  • XML-mode
  • Auto-closing of HTML tags
  • Look for gutter issues
  • Hit up arrow while selection exists
  • Scroll into view
  • newline and indent
  • electric chars
  • CSS mode changes, incl. tokenization (test quick edit, quick open symbol, etc.)
  • JS mode - indentation around for / forEach
  • Check undo/redo/dirty bit esp. around quick typing

Finally, this PR also contains the small update required by #6204.


njx included the following code: https://github.com/adobe/brackets/pull/6268/commits

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions