Comments (12)
In current version of VS Code, there seems to be a setting files.insertFinalNewline
, but that setting does not show up yet in 1.47.100 of Theia IDE. Not sure if we're just missing a monaco update here 🤷
from theia.
I cannot reproduce this on current master.
from theia.
@xai are you using the a Theia workspace to test? "Format on save" is turned on in the workspace settings. I just observed this again in the Theia IDE 1.47.100.
from theia.
I can reproduce this now (with Theia IDE 1.49.101).
from theia.
Unfortunately, Monaco Editor has no such thing as editor.action.insertFinalNewline
that we could call.
I opened a draft PR with a workaround to support the files.insertFinalNewline
setting.
Also, I feel my current workaround (i.e., the protected function) is somehow in the wrong place. Any suggestions on where it would fit better?
from theia.
Do we understand why the formatter removes the final newline? As far as I can tell, this does not happen in VS Code.
from theia.
Do we understand why the formatter removes the final newline? As far as I can tell, this does not happen in VS Code.
I think it does, see attached screencast.
vscode-finalnewline.mp4
from theia.
I'm sorry, but what am I seeing?
from theia.
I'm sorry, but what am I seeing?
This is vscode (cleaned user data) with a workspace that has formatOnSave enabled (see right pane).
Initially, insertFinalNewline is not set (right pane).
On the first save action, the empty line at the end of the package.json in the left pane is removed automatically (i.e., line 46 is deleted in the package.json).
Then, I enabled the insertFinalNewline setting in the right pane and repeated the experiment with the package.json. The second save does not remove the empty line, i.e. line 46 remains.
from theia.
from theia.
@xai What's the reason the PR is in draft state?
from theia.
@xai What's the reason the PR is in draft state?
Also, I feel my current workaround (i.e., the protected function) is somehow in the wrong place. Any suggestions on where it would fit better?
This concern of mine was the reason I kept it in draft state.
from theia.
Related Issues (20)
- Menu bar does not open on first click when certain sidebar elements have focus HOT 6
- Multiple Unsupported Activation Events and Plugin Loading Errors in Theia 1.52.0 on Windows 11 HOT 7
- Localization and Activation Failures in Theia with ms-python.python and ms-python.debugpy Plugins HOT 3
- Implement missing activation events HOT 2
- [vscode] proposed API evolution and menu declarations between 1.91 and 1.92 HOT 1
- [vscode] bump API compatibility version to 1.92.X
- [vscode] API gap: Theia master vs. VS Code 1.92
- [VSCode] Support `proposed.terminalShellIntegration` API
- Mismatched "ffmpeg" Architecture HOT 4
- [vscode] Support `testing/profiles/context` menu contribution point
- Update Electron Version HOT 1
- Drop nsfw support HOT 1
- Update Node supported version range HOT 1
- FileResource sometimes triggers incorrect contents change events HOT 7
- Make Theia work on NodeJS 22.x
- Preference/Setting issue when using the Redhat Java plugin HOT 2
- Make theia-ide available on android HOT 2
- Editor status bar items stay when switching to a custom editor
- Shortcut `ctrl+z` does not execute command `undo` when using 'bépo' keyboard layout HOT 4
- Tab Maximize issue on custom editors HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from theia.