Hướng dẫn eclipse javascript formatter doesn t work - trình định dạng javascript nhật thực không hoạt động

Stack Overflow cho các đội đang chuyển sang miền riêng của nó! Khi việc di chuyển hoàn tất, bạn sẽ truy cập các nhóm của mình tại StackoverFlowTeams.com và họ sẽ không còn xuất hiện ở thanh bên trái trên stackoverflow.com.stackoverflowteams.com, and they will no longer appear in the left sidebar on stackoverflow.com.

Kiểm tra email của bạn để cập nhật.

Tôi đã cài đặt "Eclipse IDE cho các nhà phát triển Java EE" 2020-06. Từ vé //bugs.eclipse.org/bugs/show_bug.cgi?id=564496 Tôi đã hiểu, rằng trình soạn thảo JavaScript độc lập không được cung cấp nữa.

Thay vào đó, các tệp JavaScript được chỉnh sửa với "Trình chỉnh sửa chung" được cung cấp bởi các tính năng phát triển của WildWebDeveler. Trình chỉnh sửa hoạt động tốt [Hỗ trợ Contentent, v.v.], nhưng đâu là sở thích để định dạng và cú pháp làm nổi bật các tệp JavaScript?

Các cài đặt trong ảnh chụp màn hình tiếp theo chỉ áp dụng cho mã JavaScript trong các tệp HTML. Tôi cũng cần các loại cài đặt như vậy cho các tệp JavaScript đơn giản để tìm thấy các hướng dẫn mã JavaScript trong dự án của tôi.

Tùy chọn -> Web -> Tệp HTML -> JavaScript phía máy khách -> Kiểu mã

Mô tả Portier 2011-09-15 11:39:37 EDT Ronald Portier 2011-09-15 11:39:37 EDT

Build Identifier: 20110218-0911

Both when formatting [CTRL+SHIFT+F, of right mouse click action] a whole source file, or when selecting lines and trying to format, nothing seems to happen, certainly the format specifications ar not honored.

Example. I have in my source a number of places where there is no space in an assigment before or the assignment operator. 

Like this: 

	needEscape=true;

Formatting preview [detail] shows this:

var index = 0;

In my preferences [named MijnFormatterVoorkeuren, dutch for My Formatting Preferences] I have specified to have a space before and after assignment operators.

Preview on tab whitespace, then expressions node, then assignment node:

var arr = new Array[];
var a = -4 + -9;
var b = a++ / --a;
a += 4;
var value = true && false;


Reproducible: Always

Steps to Reproduce:
1. Check formatting options.
2. Press CTRL+SHIFT+F
3. Nothing happens....

Làm thế nào 1Nitin Dahyabhai 2011-09-15 13:20:20 EDT Nitin Dahyabhai 2011-09-15 13:20:20 EDT

Are you working with a file in a source folder of a JavaScript Project?

Làm thế nào 2ronald Portier 2011-09-18 08:45:51 EDT Ronald Portier 2011-09-18 08:45:51 EDT

I do not exactly know I I can answer your question correctly.

The project is a web-project. The contents of the .project files are as follows:



	fakt400-html
	
	
	
	
		
			org.eclipse.wst.common.project.facet.core.builder
			
			
		
		
			org.eclipse.wst.validation.validationbuilder
			
			
		
	
	
		org.eclipse.wst.common.project.facet.core.nature
		org.eclipse.wst.common.modulecore.ModuleCoreNature
		org.eclipse.wst.jsdt.core.jsNature
		org.python.pydev.pythonNature
	


[The pydev nature is there for some build scripts]

Further more the javascript files are contained in a subdirectory of the WebContent directory.

Làm thế nào 3Nitin Dahyabhai 2011-09-18 22:41:42 EDT Nitin Dahyabhai 2011-09-18 22:41:42 EDT

Can you also post the contents of the .settings/.jsdtscope file?

Làm thế nào 4ronald Portier 2011-09-27 08:14:33 EDT Ronald Portier 2011-09-27 08:14:33 EDT

Sorry for the delay, I was away for a few days.

Here are the contents of the requested file:



	
	
	
		
			
		
	
	
	
	
	

Làm thế nào 5Nitin Dahyabhai 2011-12-07 14:52:40 là Nitin Dahyabhai 2011-12-07 14:52:40 EST

And where was the file in this project?

Làm thế nào 6ronald Porter 2011-12-08 05:00:10 Ronald Portier 2011-12-08 05:00:10 EST

Hello,

My file was actually in a subfolder WebContent/fakt400gui.

However the same problem occurs in WebContent/javascript.

After some further testing I suspect that the problem has to do with either the size of the file, or the number of changes. 

I took a large javascript file [lispanel.js - I will attach it to this bug]. Formatting would NOT work. When I truncated the file to a bit more than 200 lines, formatting would work.

To test wether the size of the file was the problem, or the number of changes, I first formatted the first 200 lines. Formatted them. Then another 114 lines [to prevent cutting a function in the middle]. These formatted OK. Then another 150 or so. Formatting did not work. Cut the source to 405 lines. Formatting worked. Added the lines just cut back in. Formatting still did not work. 

Now copied already formatted source in place of lines just re-added. So all source formatted. Then added one unformatted line. Formatting worked. Now started adding functions one by one and formatting. At a certain moment formatting stopped. Removed the last unformatted function. Added some dummy lines and one unformatted line. At about 400 lines, formatting no longer worked.

My conclusion: formatting stops working at a certain size of the source.

Làm thế nào 8tsogtgerel tsogtsaikhan 2017-01-31 06:07:21 Đông Tsogtgerel Tsogtsaikhan 2017-01-31 06:07:21 EST

character '/' make problem.

Làm thế nào 9patrik Suzzi 2017-01-31 13:33:51 là Patrik Suzzi 2017-01-31 13:33:51 EST

[In reply to Tsogtgerel Tsogtsaikhan from comment #8]
> character '/' make problem.

Hi, Tsogtgerel!

Could you please tell us which version of JSDT are you using?

Làm thế nào 10tsogtgerel tsogtsaikhan 2017-01-31 21:42:55 Đông Tsogtgerel Tsogtsaikhan 2017-01-31 21:42:55 EST

I use just Neon.2 Release of the Eclipse Java EE Developers package. I think it's bug for eclipse generally not only for JSDT.

Làm thế nào 11bogdan Butnaru 2017-02-15 06:24:56 là Bogdan Butnaru 2017-02-15 06:24:56 EST

Are you working with a file in a source folder of a JavaScript Project?
0

Làm thế nào 12rhachard Kulp 2017-02-17 12:45:52 Đông là Richard Kulp 2017-02-17 12:45:52 EST

Are you working with a file in a source folder of a JavaScript Project?
1

Làm thế nào 13Vlad Dinulescu 2017-03-25 14:12:17 EDT Vlad Dinulescu 2017-03-25 14:12:17 EDT

Are you working with a file in a source folder of a JavaScript Project?
2

Làm thế nào 14David Krizanic 2017-04-05 07:22:31 EDT David Krizanic 2017-04-05 07:22:31 EDT

Are you working with a file in a source folder of a JavaScript Project?
3

Làm thế nào 15des 12 2017-06-08 06:10:16 EDT Deses 12 2017-06-08 06:10:16 EDT

Are you working with a file in a source folder of a JavaScript Project?
4

Làm thế nào 16des 12 2017-06-08 06:10:36 EDT Deses 12 2017-06-08 06:10:36 EDT

Are you working with a file in a source folder of a JavaScript Project?
4

Làm thế nào 17Floyd Elliot 2017-07-08 17:33:56 EDT Floyd Elliot 2017-07-08 17:33:56 EDT

Are you working with a file in a source folder of a JavaScript Project?
6

Làm thế nào 18Floyd Elliot 2017-07-08 17:35:26 EDT Floyd Elliot 2017-07-08 17:35:26 EDT

Are you working with a file in a source folder of a JavaScript Project?
7

Làm thế nào 19Floyd Elliot 2017-10-03 15:45:56 EDT Floyd Elliot 2017-10-03 15:45:56 EDT

Are you working with a file in a source folder of a JavaScript Project?
8

Làm thế nào 20van Lepthien 2017-10-06 18:11:10 EDT Van Lepthien 2017-10-06 18:11:10 EDT

Are you working with a file in a source folder of a JavaScript Project?
9

Làm thế nào 21Mike Bretherick 2017-10-17 12:44:48 EDT Mike Bretherick 2017-10-17 12:44:48 EDT

I do not exactly know I I can answer your question correctly.

The project is a web-project. The contents of the .project files are as follows:



	fakt400-html
	
	
	
	
		
			org.eclipse.wst.common.project.facet.core.builder
			
			
		
		
			org.eclipse.wst.validation.validationbuilder
			
			
		
	
	
		org.eclipse.wst.common.project.facet.core.nature
		org.eclipse.wst.common.modulecore.ModuleCoreNature
		org.eclipse.wst.jsdt.core.jsNature
		org.python.pydev.pythonNature
	


[The pydev nature is there for some build scripts]

Further more the javascript files are contained in a subdirectory of the WebContent directory.
0

Làm thế nào 22lukas Zboron 2017-11-29 08:20:05 là Lukas Zboron 2017-11-29 08:20:05 EST

I do not exactly know I I can answer your question correctly.

The project is a web-project. The contents of the .project files are as follows:



	fakt400-html
	
	
	
	
		
			org.eclipse.wst.common.project.facet.core.builder
			
			
		
		
			org.eclipse.wst.validation.validationbuilder
			
			
		
	
	
		org.eclipse.wst.common.project.facet.core.nature
		org.eclipse.wst.common.modulecore.ModuleCoreNature
		org.eclipse.wst.jsdt.core.jsNature
		org.python.pydev.pythonNature
	


[The pydev nature is there for some build scripts]

Further more the javascript files are contained in a subdirectory of the WebContent directory.
1

Làm thế nào 23Bruno Harbulot 2018-05-10 09:52:22 EDT Bruno Harbulot 2018-05-10 09:52:22 EDT

I do not exactly know I I can answer your question correctly.

The project is a web-project. The contents of the .project files are as follows:



	fakt400-html
	
	
	
	
		
			org.eclipse.wst.common.project.facet.core.builder
			
			
		
		
			org.eclipse.wst.validation.validationbuilder
			
			
		
	
	
		org.eclipse.wst.common.project.facet.core.nature
		org.eclipse.wst.common.modulecore.ModuleCoreNature
		org.eclipse.wst.jsdt.core.jsNature
		org.python.pydev.pythonNature
	


[The pydev nature is there for some build scripts]

Further more the javascript files are contained in a subdirectory of the WebContent directory.
2

Bài Viết Liên Quan

Chủ Đề