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

paste auto add a space in frist code line, if has comment information #127589

Closed
fjqingyou opened this issue Jun 30, 2021 · 11 comments
Closed

paste auto add a space in frist code line, if has comment information #127589

fjqingyou opened this issue Jun 30, 2021 · 11 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@fjqingyou
Copy link

fjqingyou commented Jun 30, 2021

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version:
version: 1.57.1
commit id: 507ce72a4466fbb27b715c3722558bb15afa9f48
date: 2021-06-17T13:28:32.912Z
Electron: 12.0.7
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Darwin x64 19.6.0
  • OS Version:
CPUs | Intel(R) Core(TM) i7-4578U CPU @ 3.00GHz (4 x 3000)
-- | --
GPU Status | 2d_canvas: enabled gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled webgl: enabled webgl2: enabled
Load (avg) | 9, 7, 10
Memory (System) | 8.00GB (0.09GB free)
Process Argv | --crash-reporter-id 0ef084cd-d70e-4057-817f-d584807c8061
Screen Reader | no
VM | 0%


Steps to Reproduce:

template

//template 1
/**
 * add a Test msg
 */
export class Test{

}
//template 2
/**
 * add a Test msg
 */
export class Test{

    /**
     * test method
     */
    public static testMethod() : void{

    }
}
//template 3
/**
 * add a Test msg
 */
export class Test{
    /**
     * test field
     */
    test : number = 0;
}

in class

1.To copy the above template1 code,you must also select the comment information to copy

2.create a new file "Test.ts" and paste template1 code

result.

auto add a space in line 5

in method

1.To copy the above template2 code, select line 6 t 12, command + x shear it,

2.command + v paste it

result.

auto add a space in line 10

in field

template 3. Same as method

@jrieken jrieken added the info-needed Issue requires more information from poster label Jul 2, 2021
@jrieken
Copy link
Member

jrieken commented Jul 2, 2021

Doesn't reproduce for me... Do you have this setting configured: editor.formatOnPaste?

Iff not, it might be caused by one of your installed extensions. All extensions execute together on a single nodejs process, so in order to narrow down the possible problematic extension, please try the following:

  • run F1 > Help: Start Extension Bisect
  • (this will restart VS Code with half of your extensions disabled)
  • try to do the steps which reproduce the problem
  • if the problem reproduces, click "This is bad" (this narrows down the problematic extension to the half which was enabled)
  • if the problem does not reproduce, click "Good now" (this narrows down the problematic extension to the half which was disabled)
  • these steps will repeat until the problematic extension is found
initial step final
image image image

@fjqingyou
Copy link
Author

fjqingyou commented Jul 2, 2021

editor.formatOnPaste not setting it
i use win10 create a empty project, The problem is also repeated

QQ_20210702231549

// 将设置放入此文件中以覆盖默认设置
{	

	//csharp
	"csharp.format.enable": false,
	"csharpextensions.useDefaultStaticNamespace": true,
    "csharp.suppressDotnetInstallWarning": true,
    "csharp.suppressDotnetRestoreNotification": false,
	"csharp.suppressHiddenDiagnostics": true,//隐藏未使用的using
	"[csharp]": {
		
    },
    
    //csharpfixformat
    "csharpfixformat.style.spaces.beforeParenthesis": false,
    "csharpfixformat.style.spaces.afterParenthesis": false,
    "csharpfixformat.style.spaces.insideEmptyBraces": false,
    "csharpfixformat.style.spaces.beforeIndexerBracket": false,
    "csharpfixformat.style.spaces.afterBracket": false,
	
	//omnisharp
	"omnisharp.projectLoadTimeout":600,//C#项目加载超时时间
    "omnisharp.useEditorFormattingSettings": true,
    "omnisharp.waitForDebugger": false,
    "omnisharp.autoStart": true,
    "omnisharp.maxProjectResults": 512,
    "omnisharp.loggingLevel": "information",

	//typescript
	"typescript.updateImportsOnFileMove.enabled": "always",
	"typescript.implementationsCodeLens.enabled": true,
	"typescript.referencesCodeLens.enabled": true,
	"typescript.reportStyleChecksAsWarnings": false,
    "typescript.suggest.completeFunctionCalls": true,
    "typescript.referencesCodeLens.showOnAllFunctions": true,

	//javascript
	"javascript.updateImportsOnFileMove.enabled": "always",
	"javascript.preferences.importModuleSpecifier": "non-relative",
	"javascript.suggest.completeFunctionCalls": true,
	"javascript.format.enable": true,
	"[javascript]": {
		"editor.defaultFormatter": "vscode.typescript-language-features"
	},

	//git
	"git.confirmSync": true,
	"git.enableSmartCommit": false,

	//gitlens
    "gitlens.views.search.files.layout": "list",
    "gitlens.views.repositories.files.layout": "tree",
	"gitlens.advanced.fileHistoryFollowsRenames": false,
	"gitlens.advanced.repositorySearchDepth": 3,
	"gitlens.advanced.messages": {
		// "suppressShowKeyBindingsNotice": true
	},

	//cmake tools
	"cmake.configureOnOpen": false,

	//code metrics
	"codemetrics.basics.CodeLensHiddenUnder": 11,// 复杂度小于这个级别的,也隐藏不显示
	"codemetrics.basics.CodeLensEnabled": true,// 是否在代码上方显示 Lens
	"codemetrics.basics.OverviewRulerModeEnabled": false,// 代码编辑器右侧预览区标尺上,是否显示复杂度标志

	//code metrics - switch case 
	"codemetrics.nodeconfiguration.ReturnStatement": 0,
	"codemetrics.nodeconfiguration.CaseClause": 0,
	"codemetrics.nodeconfiguration.DefaultClause": 0,
	"codemetrics.nodeconfiguration.BreakStatement": 0,

	//code metrics 复杂度阈值:低
	"codemetrics.basics.ComplexityLevelLow": 0,
	"codemetrics.basics.ComplexityColorLow": "#4bb14f",

	//code metrics 复杂度阈值:正常
	"codemetrics.basics.ComplexityLevelNormal": 5,
	"codemetrics.basics.ComplexityColorNormal": "#0066FF",

	//code metrics 复杂度阈值:高
	"codemetrics.basics.ComplexityLevelHigh": 10,
	"codemetrics.basics.ComplexityColorHigh": "#9900FF",
	// "codemetrics.basics.ComplexityColorHigh": "#ffc208",//default
	
	//code metrics 复杂度阈值:最高
	"codemetrics.basics.ComplexityLevelExtreme": 21,
	"codemetrics.basics.ComplexityColorExtreme": "#FF0000",

	//vscode
	"editor.renderWhitespace": "none",//控制编辑器在空白字符上显示符号的方式。
    "editor.emptySelectionClipboard": false, //窗口的缩放级别
	"window.title": "${activeEditorShort}${separator}${rootName}${separator}",//显示标题
	"debug.toolBarLocation": "docked",//调试栏停靠
	"debug.inlineValues": true,//当处于调试过程中时,在编辑器中内联显示变量值
	"files.autoSave": "off",//文件自动保存功能
    "files.associations": {
        "*.cs": "csharp",
		"*.bjs":"javascript",
		"*.javascript":"javascript",
		"*.asset":"asset",
		"*.meta":"meta"
	},
	//项目中排除的文件
    "files.exclude": {
		// "**/*.mat":true,
		// "**/*.meta":true,
		"**/.DS_Store":true,
		// "**/.git":false,
		// "**/.gitignore":true,
		// "**/.gitattributes":true,
		// "**/.gitmodules":true,
        "**/.svn":true,
        "**/.app":false,
		"**/*.booproj":true,
		"**/*.pidb":true,
		"**/*.suo":true,
		"**/*.user":true,
		"**/*.userprefs":true,
		"**/*.unityproj":true,
		"**/*.dll": false,
		"**/*.dll.mdb":true,
		"**/*.exe":true,
		"**/*.pdf":true,
		"**/*.mp4":true,
		// "**/*.mid":true,
		// "**/*.midi":true,
		// "**/*.wav":true,
		// "**/*.mp3":true,
		// "**/*.ogg":true,
		// "**/*.gif":true,
		// "**/*.ico":true,
		// "**/*.jpg":true,
		// "**/*.jpeg":true,
		// "**/*.png":true,
		// "**/*.psd":true,
		// "**/*.tga":true,
		"**/*.tif":true,
		"**/*.tiff":true,
		"**/*.hdr":true,
		"**/*.exr":true,
		"**/*.3ds":true,
		"**/*.3DS":true,
		"**/*.fbx":true,
		"**/*.FBX":true,
		"**/*.lxo":true,
		"**/*.LXO":true,
		"**/*.ma":true,
		"**/*.MA":true,
		"**/*.obj":true,
		"**/*.OBJ":true,
		"**/*.cubemap":true,
		"**/*.flare":true,
		// "**/*.prefab":true,
		"**/*.unity":true,
		"**/*.anim":true,
		"**/*.controller":true,
		"Library/":true,
		"library/":true,
		"obj/":true,
		"Obj/":true,
        "node_modules/":true,
		"ProjectSettings/":true,
		// "build/":true,
        // "Build/":true,
		// "temp/":true,
        // "Temp/":true
	},
	"C_Cpp.updateChannel": "Insiders",
	"workbench.iconTheme": "vscode-icons",
	"terminal.integrated.shell.osx": "/bin/bash",
	"diffEditor.ignoreTrimWhitespace": false,
    "editor.detectIndentation": false,
    "editor.multiCursorModifier": "ctrlCmd",

	"breadcrumbs.enabled": true,
    "vsicons.dontShowNewVersionMessage": true,
    "typescript.preferences.quoteStyle": "double",
    "workbench.colorTheme": "Default Dark+",
    "scf.python3.path": "",
    "scf.python2.path": "",
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
    "terminal.integrated.tabs.enabled": true,
    "terminal.integrated.tabs.location": "left",
    "files.eol": "\n",
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
}

Do you want me to provide any other information to assist positioning?

@fjqingyou
Copy link
Author

I'm write all body,
ctrl+A select all body
ctrl+x cut it
ctrl+v paste

@fjqingyou
Copy link
Author

This problem still exists

2 similar comments
@fjqingyou
Copy link
Author

This problem still exists

@fjqingyou
Copy link
Author

This problem still exists

@ssigwart
Copy link
Contributor

I think this is a duplicate of #121004 and #119225. I submitted PR #136579 last year to fix this, but it hasn't been reviewed or merged yet.

@fjqingyou
Copy link
Author

After comparison, it is found that there are indeed duplicates. so close it

@github-actions github-actions bot locked and limited conversation to collaborators May 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants
@ssigwart @jrieken @fjqingyou and others