microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
161.18k stars 28.29k forks source link

FormatOnSave is removing lines if there are more than 10000 lines #201765

Closed gbatterbee closed 6 months ago

gbatterbee commented 7 months ago

Type: Bug

Steps. Sql file with 50000 lines. Save file or click 'Format Document'

Expect file to be formatted, with no lines deleted

Actual. file is formatted. Lines after 10000 are removed

Workaround Format document Then, undo

Settings

{
  "editor.fontLigatures": true,
  "editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace",
  "editor.accessibilitySupport": "off",
  "editor.inlineSuggest.enabled": true,
  "security.workspace.trust.untrustedFiles": "open",
  "github.copilot.enable": {
    "*": true,
    "yaml": false,
    "plaintext": false,
    "markdown": false,
    "typescript": true
  },
  "html.format.endWithNewline": true,
  "files.insertFinalNewline": true,
  "files.trimFinalNewlines": true,
  "diffEditor.ignoreTrimWhitespace": false,
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[javascript]": {
    "editor.defaultFormatter": "vscode.typescript-language-features"
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "css.lint.compatibleVendorPrefixes": "warning",
  "eslint.alwaysShowStatus": true,
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "window.autoDetectColorScheme": true,
  "editor.foldingMaximumRegions": 50000,
  "git.confirmSync": false,
  "typescript.updateImportsOnFileMove.enabled": "always",
  "git.autofetch": true,
  "git.branchPrefix": "g/",
  "git.branchProtection": ["main"],
  "workbench.startupEditor": "none",
  "javascript.updateImportsOnFileMove.enabled": "always",
  "remote.SSH.defaultExtensions": ["gitpod.gitpod-remote-ssh"],
  "githubPullRequests.pullBranch": "never",
  "update.showReleaseNotes": false,
  "editor.formatOnType": true,
  "editor.minimap.enabled": false,
  "editor.formatOnSave": true,
  "editor.renderWhitespace": "all",
  "gitlens.views.branches.pullRequests.showForCommits": false,
  "remote.SSH.remotePlatform": {
    "sandbox.25zgjr.csb": "linux"
  },
  "workbench.colorTheme": "Default Light Modern",
  "editor.codeActionsOnSave": {
  }
}

VS Code version: Code 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:48:16.874Z) OS version: Darwin arm64 23.1.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M1 Pro (10 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|1, 2, 2| |Memory (System)|32.00GB (0.20GB free)| |Process Argv|--crash-reporter-id 550517d8-72ff-4bdb-b576-b35059594b7f| |Screen Reader|no| |VM|0%|
Extensions (27) Extension|Author (truncated)|Version ---|---|--- jest-snippets|and|1.9.1 vscode-tailwindcss|bra|0.10.4 vscode-typescript-refactors|can|0.0.22 npm-intellisense|chr|1.4.5 vscode-redis-client|cwe|6.9.8 vscode-eslint|dba|2.4.2 gitlens|eam|14.6.1 prettier-vscode|esb|10.1.0 vscode-github-actions|git|0.26.2 vscode-pull-request-github|Git|0.78.1 vscode-graphql|Gra|0.8.20 vscode-graphql-syntax|Gra|1.2.2 terraform|has|2.29.1 svg|joc|1.5.3 nodejs-repl|los|0.5.15 remote-containers|ms-|0.327.0 remote-ssh|ms-|0.107.1 remote-ssh-edit|ms-|0.86.0 remote-explorer|ms-|0.4.1 vsliveshare|ms-|1.0.5900 vscode-tap|num|1.0.2 vscode-react-refactor|pla|1.1.3 prisma|Pri|5.7.1 code-spell-checker|str|3.0.1 pdf|tom|1.2.2 change-case|wma|1.0.0 vscode-fhir-tools|Yan|1.5.1
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256860 vslsvsres303:30308271 vserr242cf:30382550 vsjup518:30340749 vshan820:30294714 vscoreces:30445986 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 py29gd2263:30899288 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 azure-dev_surveyone:30548225 f6dab269:30613381 2i9eh265:30646982 showlangstatbar:30737416 962ge761:30917236 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixt:30902429 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:30885898 pythontbext0:30879054 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 aa_t_chat:30882232 cp7184c:30925681 ```
VSCodeTriageBot commented 6 months ago

This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the marketplace for VS Code. See also our issue reporting guidelines. If you don't know which extension is causing the problem, you can run Help: Start extension bisect from the command palette (F1) to help identify the problem extension.

Happy Coding!