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

Shift+Option+F does not work on US extended kb layout #8914

Closed
hafuta opened this issue Jul 8, 2016 · 23 comments
Closed

Shift+Option+F does not work on US extended kb layout #8914

hafuta opened this issue Jul 8, 2016 · 23 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug keybindings VS Code keybinding issues keyboard-layout Keyboard layout issues macos Issues with VS Code on MAC/OS X verified Verification succeeded
Milestone

Comments

@hafuta
Copy link

hafuta commented Jul 8, 2016

  • VSCode Version: Code 1.3.0 (e724f26, 2016-07-07T16:52:42.674Z)
  • OS Version: Darwin x64 15.5.0

In last few versions the code format feature (shift+alt+f) is not working, I've tried to change to other key combination for the format command but it's not working, when I install v1.0 it seems to work okay, I've tried mainly on JavaScript files but it doesn't seem to work for other types also (css, json).

I don't have any other program who uses this combination or any os command that uses this key combination, I've no installed extensions and I've also tried to load the program with the '--disable-extensions' cli argument.

Thanks

@joaomoreno joaomoreno assigned alexdima and unassigned alexdima Jul 11, 2016
@joaomoreno
Copy link
Member

If you open the Developer Tools, do you see any errors there?

Does running the Format command from the Command Palette work?

What are the contents of your keybindings file?

@joaomoreno joaomoreno self-assigned this Jul 11, 2016
@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Jul 11, 2016
@alexdima
Copy link
Member

alexdima commented Jul 11, 2016

@hafuta Also what appears when you go to customize keybindings and use the Define Keybinding widget? Does VS Code recognize your key presses correctly? (Are you using a different layout keyboard)

shift-alt-f

@mbilling
Copy link

I just reported about the same issue but just for typescript .tsx files under certain circumstances but with concrete sourcefile that make is repro possible - weee :)
Maybe there is a bug in common here...
Issue #9067

@wyntau
Copy link

wyntau commented Jul 12, 2016

@joaomoreno @alexandrudima
I have the same problem.
I use vscode from the Command Palette to format a javascript file uglified by uglify-js, but it failed. It not format code correctly, and only format partially.

source file
2016-07-12 4 47 08

sublime jsFormat formated
2016-07-12 4 47 29

vscode formated
2016-07-12 4 47 45

You see, It seems like, vscode only add some spaces around brackets, letters, commas etc.

I opened vscode's ChromeDevTools, but not error msg showed.

@alexdima alexdima assigned dbaeumer and unassigned joaomoreno Jul 12, 2016
@alexdima
Copy link
Member

I think that is how tsserver decides to format. The fact that the whitespace changes indicates the integration works correctly and that tsserver simply decides to not insert newlines. Perhaps @dbaeumer knows of some config options that might help.

@wyntau
Copy link

wyntau commented Jul 12, 2016

@alexandrudima

But if I have this file(see the first line of this file)
image

Then I use code to fromat, I get this
image

I upload my file
app_01886e5b.js.zip

@dbaeumer
Copy link
Member

@treri to help tracking this down, can you please enable tsserver tracing using the following setting:

    "typescript.tsserver.trace": "verbose"

Then switch to the output view and select the TypeScript channel and format. Could you provide the created trace?

@dbaeumer dbaeumer added the typescript Typescript support issues label Jul 13, 2016
@wyntau
Copy link

wyntau commented Jul 14, 2016

@dbaeumer
this is my first file

step: just use code to format the uglified js file.

output.txt

@wyntau
Copy link

wyntau commented Jul 14, 2016

Maybe you can use my uploaded file to reproduce?

@wyntau
Copy link

wyntau commented Jul 14, 2016

@dbaeumer
this is my second file.
step:

  1. use sublime jsFormat to format entire file.
  2. join the first two lines to one line. like my above screentshot
  3. use code to format, then get the trace.
    output2.txt

@hafuta
Copy link
Author

hafuta commented Jul 16, 2016

@joaomoreno please see attached screen recording with the developer tools on the right side.
Pressing shift+alt+f does not working, same when trying to format code from the command palette, no errors in the console in both cases.

@alexandrudima I've also tried using the Define keybinding widget to define different key combination, same thing, it identifies the keys correctly but does not work.

At the moment I've installed beautify plugin in order to have the format functionality until I'll understand the issue with the built-in feature.

My keybindings.json content is:
// Place your key bindings in this file to overwrite the defaults []

6scpu5xwcn

Thanks

@wyntau
Copy link

wyntau commented Jul 28, 2016

Any progress on this issue?

@dbaeumer
Copy link
Member

dbaeumer commented Aug 3, 2016

Was on vacation for two weeks.

@dbaeumer
Copy link
Member

dbaeumer commented Aug 4, 2016

@treri for your issue I created microsoft/TypeScript#10126 to track this since it is a TS/JS server issue.

Assigning this issue back since the original reported problem from @hafuta is not addressed by this.

@dbaeumer dbaeumer assigned alexdima and unassigned dbaeumer Aug 4, 2016
@alexdima
Copy link
Member

alexdima commented Aug 5, 2016

@hafuta Any more information from you? -- otherwise I will close this issue.

@ramamurthynagaraj
Copy link

ramamurthynagaraj commented Aug 12, 2016

Hi,
I am also facing the same issue, VS code version: Version 1.4.0 (1.4.0), MAC: 10.11.5 (15F34)
Trying out shift+alt+f in keybindings gives the following.
shift+alt+f

If I type shift+alt+f in a file, I get this  ̰ character inputted instead.
I am able to right click -> format and the command palette Format Code also works.
Also was trying out if any other bindings shows the same unknown, the following does,
shift+alt+s, shift+alt+f, shift+alt+g, shift+alt+y.

@alexdima
Copy link
Member

@ramamurthynagaraj What keyboard layout do you use? Do you press AltGr (usually the one on the right hand side of the space bar) or do you press Alt (usually the one on the left hand side of the space bar) ?

@acdha
Copy link

acdha commented Sep 9, 2016

I think this depends on the configured keyboard input system. Using the U.S. layout, Shift-Option-f is the shortcut for the Ï (LATIN CAPITAL LETTER I WITH DIAERESIS). Using the ABC Extended layout, that shortcut starts the process of entering a COMBINING TILDE BELOW with whatever key you hit next.

If I enable the default U.S. layout, the default formatting shortcut works instead of inserting an Ï. If I use a different layout, it does not work because the text entry system swallows the keystroke and waits for you to enter the character with which the tilde below will be combined, which is visible but rather subtly as an underlined tilde beneath the cursor.

This behaviour is standard across all system text inputs and so I'd guess that VS Code would either need to use a lower-level interface to get the raw keyboard events or simply pick shortcuts which don't conflict. See https://support.apple.com/en-us/HT201236, http://symbolcodes.tlt.psu.edu/accents/codemacext.html, etc. or simply open the keyboard viewer (https://support.apple.com/kb/PH18449) and hold down modifier keys – the combining diacritics will display as orange.

@alexdima alexdima changed the title Code format not working on Mac Shift+Option+F does not work on US extended kb layout Sep 12, 2016
@alexdima alexdima added the macos Issues with VS Code on MAC/OS X label Sep 12, 2016
@alexdima alexdima added bug Issue identified by VS Code Team member as probable bug keybindings VS Code keybinding issues and removed info-needed Issue requires more information from poster typescript Typescript support issues labels Sep 12, 2016
@alexdima
Copy link
Member

Ok, so the action for us is to change the default keybinding for format code from Shift+Option+F to something else. Anyone has any ideas?

@alexdima alexdima added this to the Backlog milestone Sep 12, 2016
@wyntau
Copy link

wyntau commented Sep 12, 2016

#11810 (comment)

@alexdima alexdima added the keyboard-layout Keyboard layout issues label Mar 1, 2017
@alexdima
Copy link
Member

I have validated that we now (i.e. after PR #22894 aka #17521 -- in today's Insiders build) detect correctly this keypress under the US layout on OSX.

image

Furthermore, I have checked in a JSON file that shit+alt+f correctly triggers the editor.action.formatDocument action and the JSON file gets formatted.

@alexdima alexdima modified the milestones: March 2017, Backlog Mar 24, 2017
@chrmarti chrmarti added the verified Verification succeeded label Mar 30, 2017
@carl-parrish
Copy link

The shift+alt+f keybinding doesn't work for me what steps do I need to do to get it working?

@alexdima
Copy link
Member

If your keyboard layout is ABC - extended, shift+option+f goes into composition mode (drive by the OS), similar how composition works for CJK languages. If you don't care about such type of compositions, change your keyboard layout to ABC or pick a language-country keyboard layout that works for you.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug keybindings VS Code keybinding issues keyboard-layout Keyboard layout issues macos Issues with VS Code on MAC/OS X verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

10 participants