Christian Lenz created NETBEANS-27:
--------------------------------------
Summary: Editor should recognize the filetype via unix comment,
from the first line
Key: NETBEANS-27
URL: https://issues.apache.org/jira/browse/NETBEANS-27
Project: NetBeans
Issue Type: Bug
Components: editor - Formatting & Indentation, editor - Parsing &
Indexing
Affects Versions: 8.2
Reporter: Christian Lenz
I created a HTML5/JS Application with NodeJS, I activated express to use it.
After next, the express.cmd created a project template. Inside the bin folder,
there is a file called www. Here is a little example of the code:
{code}
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('jade:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
/**
* Create HTTP server.
*/
{code}
NetBeans doesn't know that this is JS code, and it will not treat it as a JS
file. So the editor should recognize the type from the comment from the first
line, which comes from unix systems(?). I tried the same source in WebStorm and
Visual Studio Code and it works very well as expected.
I don't want to set the mimetype for the www file to js, because it will affect
every file, without having an extension, which is not good. I tried it and any
file, which has no extension is now a JS file in my IDE.
So please let the editor set the mimetype from this comment, to the supported
mimetype from NetBeans.
Regards
Chris
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)