<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - clangd supports .cl files but not .ocl"
   href="https://bugs.llvm.org/show_bug.cgi?id=41906">41906</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clangd supports .cl files but not .ocl
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang-tools-extra
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>clangd
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>paul.marechal@ericsson.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21953" name="attach_21953" title="bogus file">attachment 21953</a> <a href="attachment.cgi?id=21953&action=edit" title="bogus file">[details]</a></span>
bogus file

I am trying to send OpenCL files to clangd, as it seems that it is able to
provide useful diagnostics and information for .cl files.

OpenCL source files can also end with .ocl, but in this case clangd seems to be
failing in some way.

Here is what is roughly sent to clangd:

<span class="quote">> Sending notification 'textDocument/didOpen'.
> Params: {
>     "textDocument": {
>         "uri": "file:///home/me/tests/opencl-theia-test/hello.ocl",
>         "languageId": "cpp",
>         "version": 1,
>         "text": "\n__kernel int test() {\n    return 1;\n}\n\n__kernel void HelloWorld() {\n    int a = test();\n}\n"
>     }
> }</span >

If the file ends with .ocl, when I hover a symbol I get:

<span class="quote">> Sending request 'textDocument/hover - (23)'.
> Params: {
>     "textDocument": {
>         "uri": "file:///home/me/tests/opencl-theia-test/hello.ocl"
>     },
>     "position": {
>         "line": 5,
>         "character": 16
>     }
> }
> Received response 'textDocument/hover - (23)' in 92ms. Request failed: invalid AST (-32001).</span >

I get the same error with `Go To Definition`.

However, if the file ends with .cl, everything works.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>