Git Product home page Git Product logo

Comments (7)

orta avatar orta commented on June 26, 2024

It looks like this is on purpose from the .npmignore - I wonder if the bug then is that lib/umd/languageFacts/data/html5.d.ts even exists at all then

from vscode-html-languageservice.

orta avatar orta commented on June 26, 2024

Looks like this section is removed in the 3.0.4-betas - will give those a run

from vscode-html-languageservice.

orta avatar orta commented on June 26, 2024

Looking tricky, the codebase I'm looking at pulls a lot of the html data out of this package's privates, and there doesn't seem to be a 1:1 correlation with the new webCustomData. Going to see if I can just pull some of this from the Vetur source code.

import { HTML5_GLOBAL_ATTRIBUTES, HTML5_VALUE_MAP } from 'vscode-html-languageservice/lib/umd/languageFacts/data/html5';
import { HTML5_EVENTS } from 'vscode-html-languageservice/lib/umd/languageFacts/data/html5Events';
import { HTML5_TAGS } from 'vscode-html-languageservice/lib/umd/languageFacts/data/html5Tags';

from vscode-html-languageservice.

dummdidumm avatar dummdidumm commented on June 26, 2024

It seems like that the data is now available like this:

import { htmlData } from 'vscode-html-languageservice/lib/umd/languageFacts/data/webCustomData';

htmlData implements the public interface HTMLDataV1 so it contains events tags, global attributes, and a map.

Is there any possibility to make these default language facts public, so we can import them like import { htmlData } from 'vscode-html-languageservice';?

from vscode-html-languageservice.

octref avatar octref commented on June 26, 2024

We actually publish them to https://www.npmjs.com/package/vscode-web-custom-data, but it doesn't include the types. However it includes the data according to the JSON spec. Would adding d.ts to the vscode-web-custom-data project work for your case?

If you are interested in raw data you should definitely import from vscode-web-custom-data, not the internals of html LS.

from vscode-html-languageservice.

dummdidumm avatar dummdidumm commented on June 26, 2024

Thank you for the info! I did not know about that package. I tried importing it like import htmlData from 'vscode-web-custom-data/data/browsers.html-data.json'; and it seems to work, although infered types are off a little (string not assignable to MarkupKind), but that's okay for me. But of course it would be great if you could add the types. Just to be sure: After that I would import the json like import { htmlData } from 'vscode-web-custom-data?

from vscode-html-languageservice.

aeschli avatar aeschli commented on June 26, 2024

I just published [email protected] has

  • New API getDefaultHTMLDataProvider to get the default HTML data provider
  • New API newHTMLDataProvider to create a new provider from data.

from vscode-html-languageservice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.