Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Can't unindent automatically for Verilog files #8980

Closed
vfraloo opened this issue Sep 5, 2014 · 7 comments
Closed

Can't unindent automatically for Verilog files #8980

vfraloo opened this issue Sep 5, 2014 · 7 comments

Comments

@vfraloo
Copy link

vfraloo commented Sep 5, 2014

I actived the verilog language mode of CodeMirror by following code, and it can works well.

define(function (require, exports, module) {
  'use strict';

  var LanguageManager = brackets.getModule("language/LanguageManager");

  LanguageManager.defineLanguage("systemverilog", {
    name: "Systemverilog",
    mode: "verilog",
    fileExtensions: ["v", "sv", "vh", "svh"]
  });
});

But only one problem is that, brackets can't unindent automatically when I type some keywords like "end", "endtask", "endfunction", etc, which were suppost to be.
And I tried with CodeMirror's demo, it can works correctly. So I think there may be an issue or I made some mistakes.

@dangoor
Copy link
Contributor

dangoor commented Sep 15, 2014

@vfraloo I've marked this as a low priority because our focus is on core web languages (HTML, JavaScript and CSS). If there's something we're doing differently from CodeMirror that we could reasonably improve, we'd take a pull request for this...

@marcelgerber
Copy link
Contributor

@dangoor It's actually an issue with setting electricChars: false and using our own _checkElectricChars function in Editor.js. We're assuming languages only have {[(, but in CM, modes can define their very own electric chars.
Currently, only Verilog and XML use this option.

I tested XML and indeed, when the pref closeTags is set to false, there's no electric char matching.

So this could have a bigger impact on Brackets and we should consider using CM's own electric char management.

@JeffryBooher
Copy link
Contributor

Raising priority since @marcelgerber found a more common use case.

@marcelgerber
Copy link
Contributor

FYI @JeffryBooher, a fix is already in progress, but as it involves much testing and stuff, I assume it'll be ready in a week or so.

@JeffryBooher
Copy link
Contributor

Thanks @marcelgerber!

@prafulVaishnav
Copy link
Contributor

@vfraloo Hii.. Changes has been merged into master. Can you please verify and close the issue if fixed..

@peterflynn peterflynn added this to the Release 1.3 milestone Apr 9, 2015
@nethip nethip self-assigned this Apr 10, 2015
@prafulVaishnav
Copy link
Contributor

Verified. Indentation is working fine.. Closing..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants