Java Code Examples for com.intellij.psi.stubs.StubInputStream#readVarInt()

The following examples show how to use com.intellij.psi.stubs.StubInputStream#readVarInt() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CSharpBaseVariableStubElementType.java    From consulo-csharp with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public CSharpVariableDeclStub<V> deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
	int otherModifierMask = stubInputStream.readVarInt();

	String parentQName = null;
	if(supportsParentQName())
	{
		parentQName = StringRef.toString(stubInputStream.readName());
	}

	String initializerText = null;
	if(supportsInitializer(otherModifierMask))
	{
		initializerText = StringRef.toString(stubInputStream.readName());
	}
	return new CSharpVariableDeclStub<>(stubElement, this, parentQName, otherModifierMask, initializerText);
}
 
Example 2
Source File: QualifiedName.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nullable
public static QualifiedName deserialize(StubInputStream dataStream) throws IOException {
  QualifiedName qName;
  int size = dataStream.readVarInt();
  if (size == 0) {
    qName = null;
  }
  else {
    qName = new QualifiedName(size);
    for (int i = 0; i < size; i++) {
      final StringRef name = dataStream.readName();
      qName.myComponents.add(name == null ? null : name.getString());
    }
  }
  return qName;
}
 
Example 3
Source File: CSharpAttributeListStubElementType.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public CSharpAttributeListStub deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
	int targetIndex = stubInputStream.readVarInt();
	return new CSharpAttributeListStub(stubElement, this, targetIndex == -1 ? null : DotNetAttributeTargetType.values()[targetIndex]);
}
 
Example 4
Source File: CSharpMethodStubElementType.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public CSharpMethodDeclStub deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
	StringRef qname = stubInputStream.readName();
	int otherModifierMask = stubInputStream.readVarInt();
	int operatorIndex = stubInputStream.readVarInt();
	return new CSharpMethodDeclStub(stubElement, StringRef.toString(qname), otherModifierMask, operatorIndex);
}
 
Example 5
Source File: CSharpArrayTypeStubElementType.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public CSharpWithIntValueStub<CSharpArrayType> deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
	int i = stubInputStream.readVarInt();
	return new CSharpWithIntValueStub<>(stubElement, this, i);
}
 
Example 6
Source File: CSharpXAccessorStubElementType.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public CSharpXXXAccessorStub deserialize(@Nonnull StubInputStream inputStream, StubElement stubElement) throws IOException
{
	int otherModifiers = inputStream.readVarInt();
	return new CSharpXXXAccessorStub(stubElement, otherModifiers);
}
 
Example 7
Source File: CSharpReferenceExpressionStubElementType.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public CSharpReferenceExpressionStub deserialize(@Nonnull StubInputStream dataStream, StubElement parentStub) throws IOException
{
	StringRef referenceText = dataStream.readName();
	int kind = dataStream.readVarInt();
	int memberAccessType = dataStream.readVarInt();
	boolean global = dataStream.readBoolean();
	return new CSharpReferenceExpressionStub(parentStub, this, StringRef.toString(referenceText), kind, memberAccessType, global);
}
 
Example 8
Source File: CSharpNativeTypeStubElementType.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public CSharpWithIntValueStub<CSharpNativeType> deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
	int index = stubInputStream.readVarInt();
	return new CSharpWithIntValueStub<CSharpNativeType>(stubElement, this, index);
}
 
Example 9
Source File: CSharpModifierListStubElementType.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public CSharpModifierListStub deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
	int modifierMask = stubInputStream.readVarInt();
	return new CSharpModifierListStub(stubElement, this, modifierMask);
}
 
Example 10
Source File: CSharpGenericConstraintKeywordValueStubElementType.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public CSharpWithIntValueStub<CSharpGenericConstraintKeywordValue> deserialize(@Nonnull StubInputStream stubInputStream,
		StubElement stubElement) throws IOException
{
	int index = stubInputStream.readVarInt();
	return new CSharpWithIntValueStub<CSharpGenericConstraintKeywordValue>(stubElement, this, index);
}
 
Example 11
Source File: CSharpConstructorStubElementType.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public CSharpMethodDeclStub deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
	StringRef qname = stubInputStream.readName();
	int otherModifierMask = stubInputStream.readVarInt();
	return new CSharpMethodDeclStub(stubElement, this, StringRef.toString(qname), otherModifierMask, -1);
}
 
Example 12
Source File: CSharpTypeStubElementType.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public CSharpTypeDeclStub deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
	StringRef parentQName = stubInputStream.readName();
	StringRef vmQName = stubInputStream.readName();
	int otherModifierMask = stubInputStream.readVarInt();
	return new CSharpTypeDeclStub(stubElement, StringRef.toString(parentQName), StringRef.toString(vmQName), otherModifierMask);
}