vsch / idea-multimarkdown

Markdown language support for IntelliJ IDEA.
https://plugins.jetbrains.com/plugin/7896-markdown-navigator
Apache License 2.0
812 stars 129 forks source link

Extensionless files are not found when referencing them #917

Open s2k opened 2 years ago

s2k commented 2 years ago

References to other files in Markdown are (no longer, I think), working.

An example should clarify:

Here's the example project structure:

$ tree
.
├── resources
│   ├── code
│   │   └── ruby_code.rb
│   └── texts
│       ├── clearly_a_text_file.txt
│       └── extensionless_file
└── the_text.md

All files contain some text, working Ruby code in case of the Ruby file.

In the IDE (RubyMine in my case) the example the_text.md looks like this:

extensioless_file_is_not_displayed_as-found

When the cursor hovers over the 'missing' file and I click the red '!' indicator the following options are displayed:

displayed_options

Now, when I click 'Create file and directories', then nothing happens … as long as the file in question does exist.

However, if I try to reference a file that actually doesn't exists and then opt to create the file, then that file is in fact created. Alas the IDE still doesn'T recognise that the file is actually there.

Step 1: Add reference to file that is missing:

actualy_missing_file

Step 2: Let IDE create the file:

create_the_file

Step 3: This file still isn't found:

still_not_found

Here's why I think this is a bug:

  1. I'm pretty sure this worked in previous combinations of various versions of RubyMine and this plugin.
  2. When I let the IDE (or a plugin) create a file, I expect it to find that file – especially in a situation like this, where a user let's the IDE/plugin resolve an issue.
  3. Other files with an extension are found just fine and I don't see much of a difference, especially when referencing files in software projects, that include files without extensions, such as Gemfiles in Ruby projects.
  4. The build-in Markdown plugin does allow ⌘-clicking files and folders in these references and…
    • for file opener that file
    • for directories focusses of the directory in the project pane.

Note that I am aware of the fact that the ![some_text](the_reference) is not supported by all Markdown dialects. And yet, I did work in previous versions, and I can't see a good reason to change the behaviour depending on the file extension.

A repo with the example repo is available at ➙ https://github.com/s2k/MarkdownPluginBehaviour