code-formatting

Add shortcut key for multiple plugins in Sublime Text 3

…衆ロ難τιáo~ 提交于 2021-02-11 15:37:02
问题 I'm using CodeFormatter and SassBeautify plugins in Sublime Text 3 in order to provide syntax highlighting and formatting for .scss files as well as .js/.html files. I've been able to set up shortcut keys for either plugin, but not to work for both, depending on the type of file I'm in. [{ "keys": ["ctrl+alt+f"], "command": "sass_beautify" }, { "keys": ["ctrl+alt+f"], "command": "code_formatter" }] Can someone suggest how do to it? I've tried to understand "contexts" but not well enough to do

Add shortcut key for multiple plugins in Sublime Text 3

我的梦境 提交于 2021-02-11 15:36:09
问题 I'm using CodeFormatter and SassBeautify plugins in Sublime Text 3 in order to provide syntax highlighting and formatting for .scss files as well as .js/.html files. I've been able to set up shortcut keys for either plugin, but not to work for both, depending on the type of file I'm in. [{ "keys": ["ctrl+alt+f"], "command": "sass_beautify" }, { "keys": ["ctrl+alt+f"], "command": "code_formatter" }] Can someone suggest how do to it? I've tried to understand "contexts" but not well enough to do

Add shortcut key for multiple plugins in Sublime Text 3

末鹿安然 提交于 2021-02-11 15:34:22
问题 I'm using CodeFormatter and SassBeautify plugins in Sublime Text 3 in order to provide syntax highlighting and formatting for .scss files as well as .js/.html files. I've been able to set up shortcut keys for either plugin, but not to work for both, depending on the type of file I'm in. [{ "keys": ["ctrl+alt+f"], "command": "sass_beautify" }, { "keys": ["ctrl+alt+f"], "command": "code_formatter" }] Can someone suggest how do to it? I've tried to understand "contexts" but not well enough to do

Eclipse/nsight formatter doesn't respect function body indentation policy

╄→尐↘猪︶ㄣ 提交于 2021-02-10 08:35:09
问题 I use CUDA 8.0's version of nsight (Eclipse platform 4.4.0, CDT 8.4.0). My Eclipse C/++ formatter is configured to indent as follows (image is from the Formatter config prev: but if I have this code: and I press enter, get to the next line (the cursor is placed under the span ), and type in an opening brace, it is not placed at the beginning of the line, but is rather kept indented: Is this a bug or have I misconfigured something? Notes: I tried both the built-in formatter and the "CUDA C"

What is the correct way of code comments in JavaScript

强颜欢笑 提交于 2021-02-04 11:26:30
问题 What is the correct way of code comments in Javascript - is the same syntax as in Java? And which tools actually would take advantage of these comments: /* * Add an element to the group * @param {Object} overlayElement * @param {Object} [element2] optional element */ I found new Resharper 6 (I write JS in VisualStudio 2010) offers the same comments as in C#, but only within the functions body, something like /// <param name="overlayElement"></param> . The JS code comments are not highlighted

Double newlines following function definitions

我是研究僧i 提交于 2021-01-29 03:06:52
问题 Is it possible to use clang-format to have double newlines between function definitions: void func1() { return; } void func2() { return; } 回答1: If you are asking whether the IDE can insert these lines automatically, I don't believe so. You can have any number of lines but only by manually entering them. 回答2: clang-format does not have an option controlling the number of newlines after the function definition. However, it does have an option, MaxEmptyLinesToKeep , which will keep it from

Double newlines following function definitions

五迷三道 提交于 2021-01-29 02:57:41
问题 Is it possible to use clang-format to have double newlines between function definitions: void func1() { return; } void func2() { return; } 回答1: If you are asking whether the IDE can insert these lines automatically, I don't believe so. You can have any number of lines but only by manually entering them. 回答2: clang-format does not have an option controlling the number of newlines after the function definition. However, it does have an option, MaxEmptyLinesToKeep , which will keep it from

Multiple formatters in Visual Studio Code

末鹿安然 提交于 2021-01-27 22:15:08
问题 In my team, some people are using VS Code and others WebStorm. To align code format, I've written an extension for VS Code that adds some missing rules. My plan was to run my extension along with the native formatters that ship with VS Code. I provide my edits using the API: vscode.languages.registerDocumentFormattingEditProvider('typescript', { provideDocumentFormattingEdits(document: vscode.TextDocument) { const textEdit: vscode.TextEdit[]; return textEdit; } } But it seems I can't run this

Why does COBOL have to be indented? [closed]

无人久伴 提交于 2021-01-26 20:53:06
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . Improve this question Why does COBOL have to be indented, as in, have additional spacing in each sourcefile? Consider this code (note the additional whitespace): IDENTIFICATION DIVISION. PROGRAM-ID. HELLO-WORLD. PROCEDURE DIVISION. DISPLAY 'Hello, world'. STOP RUN. A similar

Why does COBOL have to be indented? [closed]

只谈情不闲聊 提交于 2021-01-26 20:49:56
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . Improve this question Why does COBOL have to be indented, as in, have additional spacing in each sourcefile? Consider this code (note the additional whitespace): IDENTIFICATION DIVISION. PROGRAM-ID. HELLO-WORLD. PROCEDURE DIVISION. DISPLAY 'Hello, world'. STOP RUN. A similar