Skip to content

Commit

Permalink
Expand filetype support to EVERYTHING
Browse files Browse the repository at this point in the history
  • Loading branch information
Matsuuu committed Nov 7, 2023
1 parent 3e04c81 commit 2957d40
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 66 deletions.
11 changes: 0 additions & 11 deletions lib/client/neovim/custom_elements_languageserver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ return {
default_config = {
init_options = { hostInfo = 'neovim' },
cmd = cmd,
filetypes = {
'javascript',
'javascriptreact',
'javascript.jsx',
'typescript',
'typescriptreact',
'typescript.tsx',
'html',
'vue',
'php'
},
root_dir = function(fname)
return util.root_pattern 'tsconfig.json'(fname)
or util.root_pattern('package.json', 'jsconfig.json', '.git')(fname)
Expand Down
20 changes: 6 additions & 14 deletions lib/client/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,6 @@ let client: LanguageClient;

const disposables: Disposable[] = [];

const SUPPORTED_LANGUAGES = [
'javascript',
'javascriptreact',
'javascript.jsx',
'typescript',
'typescriptreact',
'typescript.tsx',
'html',
'vue',
'php'
]


function registerCommands(context: ExtensionContext) {
const restartCommandDisposable = commands.registerCommand('extension.restart', async () => {
client.stop();
Expand Down Expand Up @@ -54,10 +41,15 @@ export function activate(context: ExtensionContext) {
},
};

// TODO: Allow excluding filetypes
// Options to control the language client
let clientOptions: LanguageClientOptions = {
// documentSelector: [
// ...SUPPORTED_LANGUAGES.map(lang => ({ scheme: "file", language: lang }))
// ],
//
documentSelector: [
...SUPPORTED_LANGUAGES.map(lang => ({ scheme: "file", language: lang }))
{ scheme: "file" }
],
synchronize: {
// Notify the server about file changes to '.clientrc files contained in the workspace
Expand Down
60 changes: 30 additions & 30 deletions usage-testing-project/src/ExampleProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,40 @@ const logo = new URL("../../assets/open-wc-logo.svg", import.meta.url).href;
* user via a card-like UI component
*
* @augments LitElement
*
*
* @attribute {string} my-attribute
*
*
* @fires my-custom-event

Check warning on line 15 in usage-testing-project/src/ExampleProject.ts

View workflow job for this annotation

GitHub Actions / Qodana for JS

Syntax errors and unresolved references in JSDoc

Unresolved variable or type 'event:my-custom-event'
* */
export class ExampleProject extends LitElement {
@property({ type: String }) title = "My app";
@property({ type: String }) title = "My app";

@property({ type: String, reflect: true, attribute: "project-name" })
projectName = "Example Project";
@property({ type: String, reflect: true, attribute: "project-name" })
projectName = "Example Project";

/**
* Color of project card background and general theme
* */
@property({ type: String, reflect: true }) color = "#000000";
/**
* Color of project card background and general theme
* */
@property({ type: String, reflect: true }) color = "#000000";

/**
* Userdata for authentication and token purposes
* */
@property({ type: Object }) userData = {};
/**
* Userdata for authentication and token purposes
* */
@property({ type: Object }) userData = {};

myAttribute = "bar";
myAttribute = "bar";

matias = "BORK BORK";
matias = "BORK BORK";

constructor() {
super();
/**
* My attribute is used to do stuff
* */
this.myAttribute = "foo";
this.setAttribute("my-attribute", this.myAttribute);
}
static styles = css`
constructor() {
super();
/**
* My attribute is used to do stuff
* */
this.myAttribute = "foo";
this.setAttribute("my-attribute", this.myAttribute);
}
static styles = css`
:host {
min-height: 100vh;
display: flex;
Expand Down Expand Up @@ -85,12 +85,12 @@ export class ExampleProject extends LitElement {
}
`;

doEvent() {
this.dispatchEvent(new CustomEvent("my-custom-event"));
}
doEvent() {
this.dispatchEvent(new CustomEvent("my-custom-event"));
}

render() {
return html`
render() {
return html`
<main>
<div class="logo"><img alt="open-wc logo" src=${logo} /></div>
<h1>${this.title}</h1>
Expand All @@ -106,5 +106,5 @@ export class ExampleProject extends LitElement {
<a target="_blank" rel="noopener noreferrer" href="https://github.com/open-wc">open-wc</a>.
</p>
`;
}
}
}
62 changes: 62 additions & 0 deletions usage-testing-project/src/card.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
interface Props {
title: string;
body: string;
href: string;
}
const { href, title, body } = Astro.props;
---

<li class="link-card">
<a href={href}>
<h2>
{title}
<example-project></example-project>
<span>&rarr;</span>
</h2>
<p>
{body}
</p>
</a>
</li>
<style>
.link-card {
list-style: none;
display: flex;
padding: 1px;
background-color: #23262d;
background-image: none;
background-size: 400%;
border-radius: 7px;
background-position: 100%;
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.link-card > a {
width: 100%;
text-decoration: none;
line-height: 1.4;
padding: calc(1.5rem - 1px);
border-radius: 8px;
color: white;
background-color: #23262d;
opacity: 0.8;
}
h2 {
margin: 0;
font-size: 1.25rem;
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
p {
margin-top: 0.5rem;
margin-bottom: 0;
}
.link-card:is(:hover, :focus-within) {
background-position: 0;
background-image: var(--accent-gradient);
}
.link-card:is(:hover, :focus-within) h2 {
color: rgb(var(--accent-light));
}
</style>
19 changes: 9 additions & 10 deletions usage-testing-project/src/foo.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { html } from "lit-html";
import { repeat } from "lit/directives/repeat.js";
import "@shoelace-style/shoelace/dist/components/input/input.js";

export const temp = html`
<example-project my-attribute="f"
project-name="foo"
.projectName=""
<example-project my-attribute="f"
project-name="foo"
.projectName=""
.color="#ff094"
@my-custom-event="${() => { console.log('foo') }}"
></example-project>
Expand All @@ -15,15 +14,15 @@ export const temp = html`
<example-project .color="">
<weird-element></weird-element>
<sl-input @sl-blur="${() => { }}"></sl-input>
<sl-button variant="default"></sl-button>
<p>Foo</p>
<img src="" />
<input type="text" />
<textarea cols="40"></textarea>
Expand All @@ -38,13 +37,13 @@ document.querySelector("p");


class Foo {

Check warning on line 39 in usage-testing-project/src/foo.ts

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused class Foo
bar() {
console.log("Bin");
}
bar() {
console.log("Bin");
}
}

function doRender() {

Check warning on line 45 in usage-testing-project/src/foo.ts

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused function doRender
return html`
return html`
<p>Foo</p>
<example-project project-name=""></example-project>
Expand Down
1 change: 0 additions & 1 deletion usage-testing-project/src/markdown.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@


```html

<example-project>
```

0 comments on commit 2957d40

Please sign in to comment.