facebook

Tab identation

  1. CodeMix & Angular IDE
  2.  > 
  3. Getting Help
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #609432 Reply

    enorvaisa
    Participant

    Hello,
    I’m having trouble configuring TAB identation.
    When editing .js file using Codemix javascript editor it always idents with 4 spaces.
    I tried changing editor.insertSpaces and editor.tabSize values, but it seem they have no effect.
    I’m using eclipse Version: 2018-12 (4.10.0)

    #609433 Reply

    support-swapna
    Moderator

    enorvaisa,

    By default, CodeMix tries to detect indentation from a given file. In such case, both and editor.insertSpaces are ignored. To respect those settings, please change editor.detectIndentation to false in the Workspace Settings dialog.

    Let us know if it helps !!

    –Swapna
    Genuitec Support

    #611983 Reply

    enorvaisa
    Participant

    Hello again, sorry but editor.detectIndentation changing to false didin’t help.

    #612001 Reply

    Brian Fernandes
    Moderator

    Sorry to hear that setting didn’t help.

    1) Can you go to Preferences > CodeMix > Workspace Settings and click the settings.json link at the bottom – can you paste the entire contents of that file here please? That will tell us exactly what your settings are.

    2) Sanity check – are you sure the CodeMix JavaScript editor is being used? If you bring up the context menu on the file and choose Open With – do you see JavaScript :: CodeMix? I know you specifically mentioned this editor, just want to be sure.

    3) Do you see spaces being used even if you take a brand new, empty JS file and press tab?

    #612004 Reply

    enorvaisa
    Participant

    1) “settings”: {
    “javascript.referencesCodeLens.enabled”: true,
    “typescript.implementationsCodeLens.enabled”: true,
    “typescript.referencesCodeLens.enabled”: true,
    “auto-close-tag.SublimeText3Mode”: true,
    “javascript.validate.enable”: false,
    “editor.tabSize”: 2,
    “editor.detectIndentation”: false,
    “editor.insertSpaces”: true
    }

    2) yes
    3) it works same in old or new empty js file. What I want to achieve is that editor would add 2 spaces when pressing TAB. Now it works like that:
    – if I press TAB on empty line it adds 4 spaces
    – if line has value ‘xx’ after pressing TAB it stops when reach 4 values, so ‘xx__’, if line has value ‘xxx’ after pressing TAB it adds only one space and value becomes ‘xxx_’

    • This reply was modified 5 years, 1 month ago by enorvaisa.
    #612018 Reply

    Brian Fernandes
    Moderator

    – if line has value ‘xx’ after pressing TAB it stops when reach 4 values, so ‘xx__’, if line has value ‘xxx’ after pressing TAB it adds only one space and value becomes ‘xxx_’

    To make sure we’re on the same page – this behavior is expected, since you’re already two/three characters in, tab will result in it moving to the next tab stop, so will add two spaces or just one for the two cases you’ve described.

    – if I press TAB on empty line it adds 4 spaces

    This is strange, I was not able to replicate this problem and pressing tab on an empty line did give me just two spaces with the same setting as yours. Clearly the settings are correctly working on lines that have content.

    1) By any chance, do you have an .editorconfig file in the project that could be overriding some settings? It might be worth trying with an empty file in a new dummy project.
    2) Did you install any additional extensions? Could you share with us a list of extensions from the Help > CodeMix Extensions page as some of these could influence tab behavior.

    #612038 Reply

    enorvaisa
    Participant

    Yes we are on same page, I expect that tab should stop every 2 spaces/symbols.
    And yes I have more extensions. I have attached screenshot.

    Today I tried disabling extensions and just after disabling first extension I got situation when on newly created file TAB was using 2 spaces, on older files it was still using 4. Then I tried to increase tab size back to 4. It increased. Then I tried to decrease again to 2 spaces and it didn’t work..
    Maybe it got something to do with codemix refresh which I have done when disabling extensions.
    Now I have disabled all extensions and it still uses 4 spaces on TAB.

    Also I have noticed one more thing. There is error in lower left corner, I have also attached it.
    I’m not sure if i found correct log (I checked workspace/.metadata/.log) and found this error related with codemix:

    org.eclipse.jface.resource.DeviceResourceException: Unable to create resource URLImageDescriptor(codemixicon://fonticon//file%3A%2Fc%3A%2FUsers%2FEvaldas%2F.codemix%2Fengine%2Fresources%2Fapp%2Fextensions%2Ftheme-seti%2Ficons%2Fseti.woff/7fae42/8dc149/\E036/icon.png)
    at org.eclipse.jface.resource.ImageDescriptor.createResource(ImageDescriptor.java:185)
    at org.eclipse.jface.resource.DeviceResourceManager.allocate(DeviceResourceManager.java:55)
    at org.eclipse.jface.resource.AbstractResourceManager.create(AbstractResourceManager.java:88)
    at org.eclipse.jface.resource.ResourceManager.createImageWithDefault(ResourceManager.java:195)
    at org.eclipse.jface.resource.ImageRegistry.get(ImageRegistry.java:206)

    Maybe the problem is that somehow this change of settings is not refreshed correctly? (which I accidentally did somehow successfully today 1 time)

    Attachments:
    You must be logged in to view attached files.
    #612059 Reply

    Brian Fernandes
    Moderator

    Definitely strange behavior – I don’t think this is a question of a bad refresh, at most you will need to reopen the editor, and if you restart the IDE (which I’ll assume you’ve done) the changes are definitely going to be picked up. After restarting, you can confirm that the json file still has the desired settings.

    The error you mentioned should have no bearing on the tab/space behavior, and we do have a known issue where you’re incorrectly told an update has failed. Can you please send us your error log? You can find it at [workspace_location]/.metadata/.log

    I did not receive an answer to my first question from the previous post, so asking again:

    1) By any chance, do you have an .editorconfig file in the project that could be overriding some settings? It might be worth trying with an empty file in a new dummy project.

    Trying a new file in a new project would be an important test – is there any consistency in the tab/space behavior in that case?

    Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Tab identation

You must be logged in to post in the forum log in