I want (to make) a JS IntelliSense Plugin



  • @TroshinDV said in I want (to make) a JS IntelliSense Plugin:

    Это реализовано в https://github.com/trdm/jn-npp-scripts/blob/master/includes/Intell.js

    Although it is necessary to remake as it should, it was written in a hurry.



  • @TroshinDV

    I think when you want to use an English forum and you do not write it well, it is on you to use a translator before posting, and to feed any English responses through a translator so that you can read them.

    And it appears you have done that in your most recent post, for which everyone thanks you, I’m sure.



  • @TroshinDV I absolutely don’t understand what you are saying.
    I have no understanding of Russian Language.
    Could you please also translate the README.md to English too so that not only me but many can find your plugin useful ?



  • @Sashank999 said in I want (to make) a JS IntelliSense Plugin:

    @TroshinDV I absolutely don’t understand what you are saying.
    I have no understanding of Russian Language.
    Could you please also translate the README.md to English too so that not only me but many can find your plugin useful ?

    It’s one thing to ask someone to somehow translate into English in an English-language forum. (And as @Alan-Kilborn suggested, I think if @TroshinDV isn’t comfortable composing posts and replies in English, using a translator like translate.google.com or deepl.com, paste in the Russian that @TroshinDV writes in and grab the English translation to post into the forum is a good idea.)

    But as the developer of the plugin, it is perfectly reasonable for @TroshinDV to choose to write and pubish the README in whatetver language is most comfortable, without being required to translate for others. And since it’s easy to translate someone’s published webpage (if you are in Chrome, right-click and “Translate to English”; if you are on a different browser without google’s builtin translation, you can pass the URL to translate.google.com, like http://translate.google.com/translate?sl=auto&tl=en&u=https://github.com/trdm/jn-npp-scripts/blob/master/readme.md, and see the English translation), and since @TroshinDV has already indicated not being comfortable translating into English, I think it’s probably faster all around for you to use the auto-translation.



  • @Sashank999 said in I want (to make) a JS IntelliSense Plugin:

    Could you please also translate the README.md to English too so that not only me but many can find your plugin useful ?

    Maybe it’s good that there is no translation, will not be ashamed of the software code in front of English programmers :)))))



  • Heya !

    I need a small help.
    I now have an F5 action that automatically generates a ctags database with only keywords. Nothing other than that.
    So now, TagLEET refuses to work without the other things like path, keyword scope, etc.
    Of course it would be great if TagLEET disables other features and enables auto completion only as it doesn’t have info for the other features. I feel a bit too greedy now :| .

    As I can generate a database, I want to make a plugin that can read the database and provide autocompletion based on that.
    So, the things I need in plugin:

    • an on/off switch to enable/disable auto completion
    • an input field with “Browse” option beside it that can select a keywords file

    Can anyone please provide info of how I can do it ? I think C will be enough. I just need the documentation to plugin development.



  • @Sashank999 said in I want (to make) a JS IntelliSense Plugin:

    As I can generate a database, I want to make a plugin that can read the database and provide autocompletion based on that.

    https://github.com/trdm/jn-npp-scripts/blob/master/includes/Intell.js

    /* 
    \todo.... 2018-3-07_19-25
    	может не страдать херней, а для проектов на си и си++ использовать рекурсивные запуски типа:
    	ctags.exe -R -f u_ctagsU.txt --language=c --excmd=number
    	???? гораздо быстрее получается и гораздо точнее, что немаловажно..
    	
    // trdm 2019-02-14 08:05:07    
    \todo - при сканировании директории C:\Progekts\_E\ReactOS 
    	файл trdm.txt вырос до 80 мб. этот объем не осилить js.
    	тут надо придумать что-то другое.
    */
    //Парсим с помощью ctagsU.exe файл
    function fileToCtags( psFileName, psFirst, psFIndex ) {
    	var vFName = psFileName;
    	if(!vFName) {
    		return;
    	}
    	if(!psFIndex) {		psFIndex = 1;    }
    	var vComandLine = '';
    	var vComandLineM = ' --machinable=yes ';
    	var ctagExePath = gIntelCTagsUExeFPath;
    	if(IntellPlus.curExtension == '1s' || IntellPlus.curExtension == 'vbs' ) {
    		ctagExePath = gIntelCTagsUExeFPathSpeshl; 
    		vComandLineM = '';		// no '--machinable=yes'
        }
        var resFile = (psFIndex == 1) ? gIntelCTagsUFPath : gIntelCTagsUFPath2;
        resFile = gIntelCTagsUFPath; // Не помню зачем я сдел 2 файла,  пока оставим один.
    	var isFolder = gFso.FolderExists(psFileName);
    	if(!isFolder) {
    		var vFirst = (psFirst) ? true : false;
    		var vFChar = (vFirst) ? '' : ' -a ';
    		if(!gFso.FileExists(vFName)) return;
    		if(!gFso.FileExists(ctagExePath)) return; 	// --if0=yes --list-fields - не обрабатывается
    		vComandLine = '"'+ctagExePath+'"'+vFChar+' -R -F '+vComandLineM+' --sort=no --excmd=number -f "'+resFile+'" "'+vFName+'"';	// debugger;
    		if(psFIndex == 2) {
    			vComandLine = '"'+ctagExePath+'"'+vFChar+' -R -F --sort=no --excmd=number -f "'+resFile+'" "'+vFName+'"';	// debugger;
            }
        } else {
    		vComandLine = '"'+ctagExePath+'" -R -F '+vComandLineM+' --sort=no --excmd=number -f "'+resFile+'" "'+vFName+'"';	// debugger;
    	}
    	if(!gIntelShowParseLine) { 
    		status('Parse: '+vFName);	// var gWshShell = new ActiveXObject("WScript.Shell");
    	}
    	status('WshShell.Run: '+vComandLine);	// var gWshShell = new ActiveXObject("WScript.Shell");
    	if(gIntelShowParseLine) {
    		//message(vComandLine);    
        }
    	//writeToIntellLog('gWshShell.Run: '+vComandLine);
    	
    	gWshShell.Run(vComandLine,0,true);
    	//gWshShell.Exec()
    	return gFso.FileExists(resFile);
    }
    
    


  • @Sashank999 said in I want (to make) a JS IntelliSense Plugin:

    So, the things I need in plugin:

    • an on/off switch to enable/disable auto completion

    https://github.com/trdm/jn-npp-scripts/blob/master/includes/Intell.js

    function switchIntellMode(){
    	gIntellEnabled = !gIntellEnabled;
    	gIntellModeMenuItem.checked = gIntellEnabled;	
    }
    
    var mySwitchIntellMode = {
        text: "Intellisense (вкл/выкл)\tctrl+F8", //"Switch intell mode\tctrl+F8", 
        ctrl: true,
        shift: false,
        alt: false,
        key: 0x77,
        cmd: switchIntellMode,
    	prompt: "Функция switchIntellMode"
    };
    
    addHotKey(mySwitchIntellMode); 
    gIntellModeMenuItem = scriptsMenu.addItem(mySwitchIntellMode);
    gIntellModeMenuItem.checked = gIntellEnabled;
    
    

    сам запуск: getWordList()

    
    GlobalListener.addListener({
    	CHARADDED:function(v, pos){		// Tab не счистается символом? Не срабатывает функция..
    		if (gIntellEnabled){			//debugger;
    			gCurentCharAdded = v;
    			var curWord = getWordList();				 
    		}		
    	}
    });
    
    

    а потом смотри работу функции getWordList()



  • @Sashank999 said in I want (to make) a JS IntelliSense Plugin:

    So, the things I need in plugin:

    • an input field with “Browse” option beside it that can select a keywords file

    https://github.com/trdm/jn-npp-scripts/blob/master/includes/Intell.js

    /*	UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
    	Основная процедура запуска скрипта. Обеспечивает распознавание возможности коде-комплита, 
    	парсинг, выбор вваринта и встравку результата во view. -_- */
    function getWordList() {
     	if(gIntellDebug) {
    		debugger;
    	}	
    	gSearchCount = 0;
    	var retVal = '';
    	var curWord = IntellPlus.getCurWord(); 	<<<<<<< see that fore you task "an input field with “Browse” option beside it that can select a keywords file"
    	if (!curWord) { 
    		if(IntellPlus.isHtml()) {
    			HtmlIntell(); 
    			// \\todo - тормоза, надо отдебажить, но автоподстановка в <img src="img/Screenshot_001.png" alt=""> работает хорошо.
            }
            /*insertTemplate();*/
            if (IntellPlus.cursorInComment) {
                CommentIntell();
            }
    		return; 
    	}
    
    

    текущее слово берется прямо из редактора.



  • @Sashank999 said in I want (to make) a JS IntelliSense Plugin:

    Can anyone please provide info of how I can do it ? I think C will be enough. I just need the documentation to plugin development.

    ты же собирался на JS писать. Я практически все за тебя сделал, тебе только изучить надо.
    You were going to write on JS. I practically did everything for you, you only need to explore it.



  • @Sashank999 said in I want (to make) a JS IntelliSense Plugin:

    @TroshinDV I absolutely don’t understand what you are saying.
    I have no understanding of Russian Language.

    Use a translator https://translate.google.com/



  • @TroshinDV

    Use a translator

    You seem to have misunderstood the advice given earlier. For posting in the Notepad++ Community Forum, whether asking questions or answering questions, the post should be in English, the standard language for this forum. It is your job, as the one posting, to translate to English before posting; and it is your job, if you don’t understand the English posted in this forum, to translate back to your native language when reading. Please include the English version in all posts you make to this forum.

    Похоже, вы неправильно поняли совет, данный ранее. Сообщения на форуме сообщества Notepad++, будь то вопросы или ответы на вопросы, должны быть на английском языке, стандартном языке этого форума. Это ваша работа, как того, кто пишет, перевести на английский язык перед публикацией; и это ваша работа, если вы не понимаете английский язык, размещенный на этом форуме, перевести обратно на ваш родной язык при чтении. Пожалуйста, включайте английскую версию во все сообщения, которые вы делаете на этом форуме.



  • @Sashank999 said in I want (to make) a JS IntelliSense Plugin:

    Can anyone please provide info of how I can do it ? I think C will be enough. I just need the documentation to plugin development.

    Most of plugin development is just standard coding in whatever programming language you choose. The npp-user-manual.org has a page on Plugins (which gives the overview of plugins, even a section on “How to develop a plugin” with links to templates and examples), and has a page on Plugin Communication (which describes all the Windows messages that Notepad++ understands and responds to). The Scintilla messages are documented on the Scintilla website, and are used for controlling the editor portion of Notepad++.



  • @PeterJones said in I want (to make) a JS IntelliSense Plugin:

    Это понятно. Но я же не могу перевести посты, которые уже не смогу отредактировать.
    It’s clear. But I can’t translate posts that can no longer edit.