Community
    • Login

    Context sensitive syntax help while editing

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Terry WysockiT
      Terry Wysocki
      last edited by

      New to npp but have been using various ide for some time. I like many things in npp, but one thing I really miss is context sensitive syntax help - based upon the file type being edited (.ahk, .py, .php, .html, etc).

      Ideally, I’d like to hit F1 (or similar) and grab the word under the cursor to send to an appropriate help file for that language. None of my searches have found a way of handling anything like this. I’ve seen that I can run a Python script from npp, but no way that I can see to pass the selected word along with the file extension to the script. Has anyone come up with a solution for this kind of thing?

      Terry WysockiT 1 Reply Last reply Reply Quote 0
      • Terry WysockiT
        Terry Wysocki @Terry Wysocki
        last edited by

        Forgot to add that I have tried the Language Help plugin with some success, but although it asks for the extension of the file in the setup, I still have to select the specific for the language I want help on.

        PeterJonesP 1 Reply Last reply Reply Quote 0
        • PeterJonesP
          PeterJones @Terry Wysocki
          last edited by PeterJones

          @terry-wysocki ,

          no way that I can see to pass the selected word

          editor.getCurrentWord() if the cursor is on a single word. editor.getSelText() if you want to do the whole selection

          along with the file extension

          notepad.getCurrentFilename() and then use standard python to extract just the extension.

          Alternately, instead of going based off of extension, you can go off of what language Notepad++ associates with the current file: notepad.getCurrentLang() (which returns a value from the LANGTYPE enum)

          You can look up any of these in the PythonScript help files.

          1 Reply Last reply Reply Quote 3
          • Alan KilbornA
            Alan Kilborn
            last edited by Alan Kilborn

            Terry,

            When you are using PythonScript, it has its own context-sensitive help. If your caret is on editor.xxx() or notepad.xxx() and you invoke it, you will get help on whatever function xxx is.

            Since you are considering some scripting (I think) for your own context-sensitive help application, you might want to consider keeping that functionality even if you integrate something else for non-PythonScript Python.

            1 Reply Last reply Reply Quote 2
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors